Re: [ovs-dev] [PATCH v7 0/3] dpif-netdev: Detailed PMD performance metrics and supervision

2018-01-16 Thread Ilya Maximets
On 17.01.2018 10:49, Ilya Maximets wrote:
> Not a full review, just a note about man pages.
> Current version of netdev-dpif-unixctl.man doesn't scale and looks bad
> with different terminal widths. I refactored it to look more like a man
> page. See the incremental patch below.
> 
> What changed:
> * Dash lists re-formatted using "\(em" tags.
> * Numbered list re-formatted using ".IP N.".
> * Command option lists re-formatted using usual paragraphs with indentation.
> * Output example indented as recommended by man pages guidelines.
> * Removed extra spaces in "pmd-perf-log-set" command header.
> * 'pmd-stats-clear' moved closer to 'pmd-stats-show' for integrity.
> 
> One more thing:
> Can we rename "netdev-dpif-unixctl.man" to "dpif-netdev-unixctl.man" ?
> I don't understand why it named so.
> 
> ---
> diff --git a/lib/netdev-dpif-unixctl.man b/lib/netdev-dpif-unixctl.man
> index 82e372f..b17ffdb 100644
> --- a/lib/netdev-dpif-unixctl.man
> +++ b/lib/netdev-dpif-unixctl.man
> @@ -26,6 +26,12 @@ transmitting said packets.
>  
>  To reset these counters use \fBdpif-netdev/pmd-stats-clear\fR.
>  .
> +.IP "\fBdpif-netdev/pmd-stats-clear\fR [\fIdp\fR]"
> +Resets to zero the per pmd thread performance numbers shown by the
> +\fBdpif-netdev/pmd-stats-show\fR and \fBdpif-netdev/pmd-perf-show\fR 
> commands.
> +It will NOT reset datapath or bridge statistics, only the values shown by
> +the above commands.
> +.
>  .IP "\fBdpif-netdev/pmd-perf-show\fR [\fB-nh\fR] [\fB-it\fR \fIiter_len\fR] \
>  [\fB-ms\fR \fIms_len\fR] [\fB-pmd\fR \fIcore\fR] [\fIdp\fR]"
>  Shows detailed performance metrics for one or all pmds threads of the
> @@ -36,46 +42,88 @@ configuration parameter "other_config:pmd-perf-metrics". 
> By default it
>  is disabled. The run-time overhead, when enabled, is in the order of 1%.
>  
>  The covered metrics per iteration are:
> -  - used cycles
> -  - forwared packets
> -  - number of rx batches
> -  - packets/rx batch
> -  - max. vhostuser queue fill level
> -  - number of upcalls
> -  - cycles spent in upcalls
> -
> +.RS
> +.IP
> +.PD .4v
> +.IP \(em
> +used cycles
> +.IP \(em
> +forwared packets
> +.IP \(em
> +number of rx batches
> +.IP \(em
> +packets/rx batch
> +.IP \(em
> +max. vhostuser queue fill level
> +.IP \(em
> +number of upcalls
> +.IP \(em
> +cycles spent in upcalls
> +.PD
> +.RE
> +.IP
>  This raw recorded data is used threefold:
> -
> -1. In histograms for each of the following metrics:
> -   - cycles/iteration (logarithmic)
> -   - packets/iteration (logarithmic)
> -   - cycles/packet
> -   - packets/batch
> -   - max. vhostuser qlen (logarithmic)
> -   - upcalls
> -   - cycles/upcall (logarithmic)
> -   The histograms bins are divided linear or logarithmic.
> -
> -2. A cyclic history of the above metrics for 1024 iterations
> -
> -3. A cyclic history of the cummulative/average values per millisecond
> -   wall clock for the last 1024 milliseconds:
> -   - number of iterations
> -   - avg. cycles/iteration
> -   - packets (Kpps)
> -   - avg. packets/batch
> -   - avg. max vhost qlen
> -   - upcalls
> -   - avg. cycles/upcall
> -
> -The command options are
> -
> -\fB-nh\fR:Suppress the histograms
> -\fB-it\fR \fIiter_len\fR:   Display the last iter_len iteration stats
> -\fB-ms\fR \fIms_len\fR: Display the last ms_len millisecond stats
> -
> +.RS
> +.IP
> +.PD .4v
> +.IP 1.
> +In histograms for each of the following metrics:
> +.RS
> +.IP \(em
> +cycles/iteration (logarithmic)
> +.IP \(em
> +packets/iteration (logarithmic)
> +.IP \(em
> +cycles/packet
> +.IP \(em
> +packets/batch
> +.IP \(em
> +max. vhostuser qlen (logarithmic)
> +.IP \(em
> +upcalls
> +.IP \(em
> +cycles/upcall (logarithmic)
> +The histograms bins are divided linear or logarithmic.
> +.RE
> +.IP 2.
> +A cyclic history of the above metrics for 1024 iterations
> +.IP 3.
> +A cyclic history of the cummulative/average values per millisecond wall
> +clock for the last 1024 milliseconds:
> +.RS
> +.IP \(em
> +number of iterations
> +.IP \(em
> +avg. cycles/iteration
> +.IP \(em
> +packets (Kpps)
> +.IP \(em
> +avg. packets/batch
> +.IP \(em
> +avg. max vhost qlen
> +.IP \(em
> +upcalls
> +.IP \(em
> +avg. cycles/upcall
> +.RE
> +.PD
> +.RE
> +.IP
> +.
> +The command options are:
> +.RS
> +.IP "\fB-nh\fR"
> +Suppress the histograms
> +.IP "\fB-it\fR \fIiter_len\fR"
> +Display the last iter_len iteration stats
> +.IP "\fB-ms\fR \fIms_len\fR"
> +Display the last ms_len millisecond stats
> +.RE
> +
> +.IP
>  The output always contains the following global PMD statistics:
> -
> +.RS
> +.IP
>  Time: 15:24:55.270 .br
>  Measurement duration: 1.008 s
>  
> @@ -91,7 +139,8 @@ pmd thread numa_id 0 core_id 1:
>- Megaflow hits:  3262943  (90.7 %, 1.00 subtbl lookups/hit)
>- Upcalls:  0  ( 0.0 %, 0.0 us/upcall)
>- Lost upcalls: 0  ( 0.0 %)
> -
> +.RE
> +.IP
>  Here "Packets" actually reflects 

Re: [ovs-dev] [PATCH v7 0/3] dpif-netdev: Detailed PMD performance metrics and supervision

2018-01-16 Thread Ilya Maximets
Not a full review, just a note about man pages.
Current version of netdev-dpif-unixctl.man doesn't scale and looks bad
with different terminal widths. I refactored it to look more like a man
page. See the incremental patch below.

What changed:
* Dash lists re-formatted using "\(em" tags.
* Numbered list re-formatted using ".IP N.".
* Command option lists re-formatted using usual paragraphs with indentation.
* Output example indented as recommended by man pages guidelines.
* Removed extra spaces in "pmd-perf-log-set" command header.
* 'pmd-stats-clear' moved closer to 'pmd-stats-show' for integrity.

One more thing:
Can we rename "netdev-dpif-unixctl.man" to "dpif-netdev-unixctl.man" ?
I don't understand why it named so.

---
diff --git a/lib/netdev-dpif-unixctl.man b/lib/netdev-dpif-unixctl.man
index 82e372f..b17ffdb 100644
--- a/lib/netdev-dpif-unixctl.man
+++ b/lib/netdev-dpif-unixctl.man
@@ -26,6 +26,12 @@ transmitting said packets.
 
 To reset these counters use \fBdpif-netdev/pmd-stats-clear\fR.
 .
+.IP "\fBdpif-netdev/pmd-stats-clear\fR [\fIdp\fR]"
+Resets to zero the per pmd thread performance numbers shown by the
+\fBdpif-netdev/pmd-stats-show\fR and \fBdpif-netdev/pmd-perf-show\fR commands.
+It will NOT reset datapath or bridge statistics, only the values shown by
+the above commands.
+.
 .IP "\fBdpif-netdev/pmd-perf-show\fR [\fB-nh\fR] [\fB-it\fR \fIiter_len\fR] \
 [\fB-ms\fR \fIms_len\fR] [\fB-pmd\fR \fIcore\fR] [\fIdp\fR]"
 Shows detailed performance metrics for one or all pmds threads of the
@@ -36,46 +42,88 @@ configuration parameter "other_config:pmd-perf-metrics". By 
default it
 is disabled. The run-time overhead, when enabled, is in the order of 1%.
 
 The covered metrics per iteration are:
-  - used cycles
-  - forwared packets
-  - number of rx batches
-  - packets/rx batch
-  - max. vhostuser queue fill level
-  - number of upcalls
-  - cycles spent in upcalls
-
+.RS
+.IP
+.PD .4v
+.IP \(em
+used cycles
+.IP \(em
+forwared packets
+.IP \(em
+number of rx batches
+.IP \(em
+packets/rx batch
+.IP \(em
+max. vhostuser queue fill level
+.IP \(em
+number of upcalls
+.IP \(em
+cycles spent in upcalls
+.PD
+.RE
+.IP
 This raw recorded data is used threefold:
-
-1. In histograms for each of the following metrics:
-   - cycles/iteration (logarithmic)
-   - packets/iteration (logarithmic)
-   - cycles/packet
-   - packets/batch
-   - max. vhostuser qlen (logarithmic)
-   - upcalls
-   - cycles/upcall (logarithmic)
-   The histograms bins are divided linear or logarithmic.
-
-2. A cyclic history of the above metrics for 1024 iterations
-
-3. A cyclic history of the cummulative/average values per millisecond
-   wall clock for the last 1024 milliseconds:
-   - number of iterations
-   - avg. cycles/iteration
-   - packets (Kpps)
-   - avg. packets/batch
-   - avg. max vhost qlen
-   - upcalls
-   - avg. cycles/upcall
-
-The command options are
-
-\fB-nh\fR:Suppress the histograms
-\fB-it\fR \fIiter_len\fR:   Display the last iter_len iteration stats
-\fB-ms\fR \fIms_len\fR: Display the last ms_len millisecond stats
-
+.RS
+.IP
+.PD .4v
+.IP 1.
+In histograms for each of the following metrics:
+.RS
+.IP \(em
+cycles/iteration (logarithmic)
+.IP \(em
+packets/iteration (logarithmic)
+.IP \(em
+cycles/packet
+.IP \(em
+packets/batch
+.IP \(em
+max. vhostuser qlen (logarithmic)
+.IP \(em
+upcalls
+.IP \(em
+cycles/upcall (logarithmic)
+The histograms bins are divided linear or logarithmic.
+.RE
+.IP 2.
+A cyclic history of the above metrics for 1024 iterations
+.IP 3.
+A cyclic history of the cummulative/average values per millisecond wall
+clock for the last 1024 milliseconds:
+.RS
+.IP \(em
+number of iterations
+.IP \(em
+avg. cycles/iteration
+.IP \(em
+packets (Kpps)
+.IP \(em
+avg. packets/batch
+.IP \(em
+avg. max vhost qlen
+.IP \(em
+upcalls
+.IP \(em
+avg. cycles/upcall
+.RE
+.PD
+.RE
+.IP
+.
+The command options are:
+.RS
+.IP "\fB-nh\fR"
+Suppress the histograms
+.IP "\fB-it\fR \fIiter_len\fR"
+Display the last iter_len iteration stats
+.IP "\fB-ms\fR \fIms_len\fR"
+Display the last ms_len millisecond stats
+.RE
+
+.IP
 The output always contains the following global PMD statistics:
-
+.RS
+.IP
 Time: 15:24:55.270 .br
 Measurement duration: 1.008 s
 
@@ -91,7 +139,8 @@ pmd thread numa_id 0 core_id 1:
   - Megaflow hits:  3262943  (90.7 %, 1.00 subtbl lookups/hit)
   - Upcalls:  0  ( 0.0 %, 0.0 us/upcall)
   - Lost upcalls: 0  ( 0.0 %)
-
+.RE
+.IP
 Here "Packets" actually reflects the number of packets forwarded by the
 datapath. "Datapath passes" matches the number of packet lookups as
 reported by the \fBdpif-netdev/pmd-stats-show\fR command.
@@ -99,29 +148,25 @@ reported by the \fBdpif-netdev/pmd-stats-show\fR command.
 To reset the counters and start a new measurement use
 \fBdpif-netdev/pmd-stats-clear\fR.
 .
-.IP "\fBdpif-netdev/pmd-stats-clear\fR 

[ovs-dev] Recursos Humanos 2018

2018-01-16 Thread Certificación Well + 11 Temas
Buenos Días,

En gusto compartirle la información de nuestra más reciente Póliza de 
Capacitación Online con un precio especial ¡a casi 40% del precio real!

Este programa está orientado a todo el personal involucrado con los Recursos 
Humanos de su empresa y le permitirá conocer las herramientas más actualizadas 
para reclutar personal, las actualizaciones en los contratos laborales y los 
CFDI de nóminas así como le enseñará a como elevar la productividad en su 
equipo de trabajo teniendo objetivos claros y medibles.
Aproveche la oportunidad de adquirir nuestras conferencias online que incluyen 
además material de apoyo y cuestionario de aprovechamiento. 

¡La capacitación online más efectiva del mercado!

Los módulos que incluye son los siguientes:

1. Contratos Laborales en México.
2. Reclutamiento 3.0.
3. Pruebas Psicométricas de Personalidad.
4. Cómo son los CFDI de Nóminas a partir del 2018.
5. Gestión por competencias / Gestión por conocimientos.
6. Sistema de Incentivos por Objetivos.
7. Desarrollo de Talento a través de Entornos Digitales.
8. Evaluación del Clima Organizacional. 
9. Trabajadores Comprometidos hasta la Médula. 
10. Cómo Registrar e Implementar el plan y Programas de Capacitación, 
Adiestramiento y Productividad ante la STPS.
11. Certificación Well.
12. Un poco de Presión siempre ayuda.

Solicite la información completa que incluye temarios, información de 
expositores y beneficios adicionales de adquirir el programa enviándonos la 
palabra RRHH junto con los datos siguientes:

Nombre: 
Teléfono:
Empresa:

centro telefónico: 018002129393





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


Re: [ovs-dev] [PATCH 1/2] rhel: add missing mandatory build dependencies

2018-01-16 Thread Ansis Atteka
On 16 January 2018 at 15:55, Ansis Atteka  wrote:
> From: Ansis Atteka 
>
> autoconf, automake and libtool are required for ./boot.sh.
>
> python-sphinx is required to prevent an error where ovs-test.8 is
> otherwise not generated.
>
> Signed-off-by: Ansis Atteka 
> ---

Greg in 2/2 patch approved this 1/2 patch too. Pushed to master branch as well.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 2/2] rhel: Add the new ovsdb manpages to %files list (also for RHEL)

2018-01-16 Thread Ansis Atteka
On 16 January 2018 at 16:49, Gregory Rose  wrote:
> On 1/16/2018 3:55 PM, Ansis Atteka wrote:
>>
>> From: Ansis Atteka 
>>
>> Currently, "rpmbuild -bb rhel/openvswitch.spec" doesn't work correctly
>> since the new ovsdb manpages (ovsdb.5, ovsdb.7 and ovsdb-server.7) were
>> added.
>>
>> This patch adds the new ovsdb manpages in the %files list in the spec
>> file.
>>
>> CC: Ben Pfaff 
>> Fixes: 12b84d50e032 ("ovsdb: Improve documentation.")
>> Signed-off-by: Ansis Atteka 
>> ---
>>   rhel/openvswitch.spec.in | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in
>> index c1d2376df..104b27329 100644
>> --- a/rhel/openvswitch.spec.in
>> +++ b/rhel/openvswitch.spec.in
>> @@ -228,8 +228,11 @@ exit 0
>>   /usr/share/man/man1/ovsdb-server.1.gz
>>   /usr/share/man/man1/ovsdb-tool.1.gz
>>   /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
>> +%{_mandir}/man5/ovsdb.5*
>>   /usr/share/man/man5/vtep.5.gz
>>   /usr/share/man/man7/ovs-fields.7.gz
>> +%{_mandir}/man7/ovsdb.7*
>> +%{_mandir}/man7/ovsdb-server.7*
>>   /usr/share/man/man8/ovs-appctl.8.gz
>>   /usr/share/man/man8/ovs-bugtool.8.gz
>>   /usr/share/man/man8/ovs-ctl.8.gz
>
>
> I tested the patches and the fix works.
>
> Thanks Ansis!
>
> For both patches...
>

I pushed both patches to master branch. Thanks for review.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 2/2] rhel: Add the new ovsdb manpages to %files list (also for RHEL)

2018-01-16 Thread Gregory Rose

On 1/16/2018 3:55 PM, Ansis Atteka wrote:

From: Ansis Atteka 

Currently, "rpmbuild -bb rhel/openvswitch.spec" doesn't work correctly
since the new ovsdb manpages (ovsdb.5, ovsdb.7 and ovsdb-server.7) were
added.

This patch adds the new ovsdb manpages in the %files list in the spec
file.

CC: Ben Pfaff 
Fixes: 12b84d50e032 ("ovsdb: Improve documentation.")
Signed-off-by: Ansis Atteka 
---
  rhel/openvswitch.spec.in | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in
index c1d2376df..104b27329 100644
--- a/rhel/openvswitch.spec.in
+++ b/rhel/openvswitch.spec.in
@@ -228,8 +228,11 @@ exit 0
  /usr/share/man/man1/ovsdb-server.1.gz
  /usr/share/man/man1/ovsdb-tool.1.gz
  /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
+%{_mandir}/man5/ovsdb.5*
  /usr/share/man/man5/vtep.5.gz
  /usr/share/man/man7/ovs-fields.7.gz
+%{_mandir}/man7/ovsdb.7*
+%{_mandir}/man7/ovsdb-server.7*
  /usr/share/man/man8/ovs-appctl.8.gz
  /usr/share/man/man8/ovs-bugtool.8.gz
  /usr/share/man/man8/ovs-ctl.8.gz


I tested the patches and the fix works.

Thanks Ansis!

For both patches...

Tested-by: Greg Rose 
Reviewed-by: Greg Rose 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH V2] rhel: Ensure proper OVS kernel modules load after upgrade

2018-01-16 Thread Gregory Rose

On 1/16/2018 3:39 PM, Ansis Atteka wrote:

On 16 January 2018 at 15:33, Gregory Rose  wrote:

On 1/16/2018 2:38 PM, Guru Shetty wrote:



On 16 January 2018 at 08:44, Greg Rose > wrote:

 Add post install and post un-install scripts to make sure that the
 openvswitch kernel modules are correctly written with the weak-modules
 utility. This ensures that after an upgrade to a newer kernel the
 correct openvswitch kernel modules from a previous installation will
 be found by the depmod search path.

 Suggested-by: Flavio Leitner >
 Signed-off-by: Greg Rose >


Woudn't dist.conf override the contents of openvswitch.conf and you still
choose inbuilt kernel module?


It was my understanding that this would obviate the need for fiddling with
the depmod search path by correct usage of the weak-modules utility.



I already pushed this patch to master and branch-2.8 before seeing
Guru's question about depmod config changes. Greg, please send another
patch if there is something else needed.


Once some internal testing is done with a build including this patch, if 
the patch is not sufficient then we still have Guru's fix to try.  Let's 
wait and see.


Thanks,

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


[ovs-dev] [PATCH 2/2] rhel: Add the new ovsdb manpages to %files list (also for RHEL)

2018-01-16 Thread Ansis Atteka
From: Ansis Atteka 

Currently, "rpmbuild -bb rhel/openvswitch.spec" doesn't work correctly
since the new ovsdb manpages (ovsdb.5, ovsdb.7 and ovsdb-server.7) were
added.

This patch adds the new ovsdb manpages in the %files list in the spec
file.

CC: Ben Pfaff 
Fixes: 12b84d50e032 ("ovsdb: Improve documentation.")
Signed-off-by: Ansis Atteka 
---
 rhel/openvswitch.spec.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in
index c1d2376df..104b27329 100644
--- a/rhel/openvswitch.spec.in
+++ b/rhel/openvswitch.spec.in
@@ -228,8 +228,11 @@ exit 0
 /usr/share/man/man1/ovsdb-server.1.gz
 /usr/share/man/man1/ovsdb-tool.1.gz
 /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
+%{_mandir}/man5/ovsdb.5*
 /usr/share/man/man5/vtep.5.gz
 /usr/share/man/man7/ovs-fields.7.gz
+%{_mandir}/man7/ovsdb.7*
+%{_mandir}/man7/ovsdb-server.7*
 /usr/share/man/man8/ovs-appctl.8.gz
 /usr/share/man/man8/ovs-bugtool.8.gz
 /usr/share/man/man8/ovs-ctl.8.gz
-- 
2.14.1

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


[ovs-dev] [PATCH 1/2] rhel: add missing mandatory build dependencies

2018-01-16 Thread Ansis Atteka
From: Ansis Atteka 

autoconf, automake and libtool are required for ./boot.sh.

python-sphinx is required to prevent an error where ovs-test.8 is
otherwise not generated.

Signed-off-by: Ansis Atteka 
---
 rhel/openvswitch.spec.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in
index e510d351b..c1d2376df 100644
--- a/rhel/openvswitch.spec.in
+++ b/rhel/openvswitch.spec.in
@@ -36,6 +36,8 @@ Requires: logrotate, hostname, python >= 2.7, python-six
 BuildRequires: python-six
 BuildRequires: openssl-devel
 BuildRequires: checkpolicy, selinux-policy-devel
+BuildRequires: autoconf, automake, libtool
+BuildRequires: python-sphinx
 
 %bcond_without check
 %bcond_with check_datapath_kernel
-- 
2.14.1

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


Re: [ovs-dev] [PATCH V2] rhel: Ensure proper OVS kernel modules load after upgrade

2018-01-16 Thread Ansis Atteka
On 16 January 2018 at 15:33, Gregory Rose  wrote:
> On 1/16/2018 2:38 PM, Guru Shetty wrote:
>>
>>
>>
>> On 16 January 2018 at 08:44, Greg Rose > > wrote:
>>
>> Add post install and post un-install scripts to make sure that the
>> openvswitch kernel modules are correctly written with the weak-modules
>> utility. This ensures that after an upgrade to a newer kernel the
>> correct openvswitch kernel modules from a previous installation will
>> be found by the depmod search path.
>>
>> Suggested-by: Flavio Leitner > >
>> Signed-off-by: Greg Rose > >
>>
>>
>> Woudn't dist.conf override the contents of openvswitch.conf and you still
>> choose inbuilt kernel module?
>
>
> It was my understanding that this would obviate the need for fiddling with
> the depmod search path by correct usage of the weak-modules utility.
>


I already pushed this patch to master and branch-2.8 before seeing
Guru's question about depmod config changes. Greg, please send another
patch if there is something else needed.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH V2] rhel: Ensure proper OVS kernel modules load after upgrade

2018-01-16 Thread Guru Shetty
On 16 January 2018 at 08:44, Greg Rose  wrote:

> Add post install and post un-install scripts to make sure that the
> openvswitch kernel modules are correctly written with the weak-modules
> utility. This ensures that after an upgrade to a newer kernel the
> correct openvswitch kernel modules from a previous installation will
> be found by the depmod search path.
>
> Suggested-by: Flavio Leitner 
> Signed-off-by: Greg Rose 
>

Woudn't dist.conf override the contents of openvswitch.conf and you still
choose inbuilt kernel module?


>
> ---
> V2 - Modify the correct kmod spec file
> ---
>  rhel/openvswitch-kmod-fedora.spec.in | 23 ++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/rhel/openvswitch-kmod-fedora.spec.in b/rhel/openvswitch-kmod-
> fedora.spec.in
> index 93adb03..c0cd298 100644
> --- a/rhel/openvswitch-kmod-fedora.spec.in
> +++ b/rhel/openvswitch-kmod-fedora.spec.in
> @@ -57,7 +57,28 @@ rm -rf $RPM_BUILD_ROOT
>
>  %post
>  # Ensure that modprobe will find our modules.
> -depmod %{kernel}
> +for k in $(cd /lib/modules && /bin/ls); do
> +[ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k"
> +done
> +if [ -x "/sbin/weak-modules" ]; then
> +for m in openvswitch vport-gre vport-stt vport-geneve \
> + vport-lisp vport-vxlan; do
> +echo "/lib/modules/%{kernel}/extra/$m.ko"
> +done | /sbin/weak-modules --add-modules
> +fi
> +
> +%postun
> +for k in $(cd /lib/modules && /bin/ls); do
> +[ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k"
> +done
> +if [ "$1" = 0 ]; then  # Erase, not upgrade
> +if [ -x "/sbin/weak-modules" ]; then
> +for m in openvswitch vport-gre vport-stt vport-geneve \
> + vport-lisp vport-vxlan; do
> +echo "/lib/modules/%{kernel}/extra/$m.ko"
> +done | /sbin/weak-modules --remove-modules
> +fi
> +fi
>
>  %files
>  %defattr(0644,root,root)
> --
> 1.8.3.1
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH V2] rhel: Ensure proper OVS kernel modules load after upgrade

2018-01-16 Thread Flavio Leitner
On Tue, Jan 16, 2018 at 10:31:29AM -0800, Gregory Rose wrote:
> On 1/16/2018 10:15 AM, Flavio Leitner wrote:
> > On Tue, Jan 16, 2018 at 08:44:15AM -0800, Greg Rose wrote:
> > > Add post install and post un-install scripts to make sure that the
> > > openvswitch kernel modules are correctly written with the weak-modules
> > > utility. This ensures that after an upgrade to a newer kernel the
> > > correct openvswitch kernel modules from a previous installation will
> > > be found by the depmod search path.
> > > 
> > > Suggested-by: Flavio Leitner 
> > > Signed-off-by: Greg Rose 
> > > 
> > > ---
> > LGTM, though I have not tested.
> > 
> > Acked-by: Flavio Leitner 
> > 
> 
> Thank you Flavio!

Thank you for fixing it :-)

-- 
Flavio

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


Re: [ovs-dev] [PATCH] dpif-netlink-rtnl: Work around MTU bug in kernel GRE driver.

2018-01-16 Thread Eric Garver
On Tue, Jan 16, 2018 at 09:16:47AM -0800, Ben Pfaff wrote:
> On Tue, Jan 16, 2018 at 10:42:16AM -0500, Eric Garver wrote:
> > On Fri, Jan 12, 2018 at 12:44:59PM -0800, Ben Pfaff wrote:
> > > The kernel GRE driver ignores IFLA_MTU in RTM_NEWLINK requests and
> > > overrides the MTU to 1472 bytes.  This commit works around the problem by
> > > following up a request to create a GRE device with a second request to set
> > > the MTU.
> > > 
> > > Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1488484
> > > Reported-by: Eric Garver 
> > > Reported-by: James Page 
> > > Signed-off-by: Ben Pfaff 
> > > ---
> > > This is not properly tested.  It needs to be tested before it makes sense
> > > to commit it.
> > > 
> > >  lib/dpif-netlink-rtnl.c | 13 +
> > >  1 file changed, 13 insertions(+)
> > > 
> > > diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c
> > > index fe9c8ed7104f..0bf965d29f41 100644
> > > --- a/lib/dpif-netlink-rtnl.c
> > > +++ b/lib/dpif-netlink-rtnl.c
> > > @@ -329,6 +329,19 @@ dpif_netlink_rtnl_create(const struct 
> > > netdev_tunnel_config *tnl_cfg,
> > >  nl_msg_end_nested(, linkinfo_off);
> > >  
> > >  err = nl_transact(NETLINK_ROUTE, , NULL);
> > > +if (!err && type == OVS_VPORT_TYPE_GRE) {
> > > +/* Work around a bug in kernel GRE driver, which ignores 
> > > IFLA_MTU in
> > > + * RTM_NEWLINK, by setting the MTU again.  See
> > > + * https://bugzilla.redhat.com/show_bug.cgi?id=1488484. */
> > > +ofpbuf_clear();
> > > +nl_msg_put_nlmsghdr(, 0, RTM_SETLINK,
> > > +NLM_F_REQUEST | NLM_F_ACK);
> > > +ofpbuf_put_zeros(, sizeof(struct ifinfomsg));
> > > +nl_msg_put_string(, IFLA_IFNAME, name);
> > > +nl_msg_put_u32(, IFLA_MTU, UINT16_MAX);
> > 
> > James' testing found that this value will be rejected by the kernel. GRE
> > driver uses ip_tunnel_change_mtu() with the "strict" parameter, so it
> > will return an error instead of clamping the value. GENEVE/VXLAN always
> > clamp the value.
> > 
> > I think 65478 is the max_mtu for gretap accounting for optional csum,
> > key, seq in gre_calc_hlen(). It may be slightly higher for how OVS
> > configures gretap.
> > 
> >   0xFFF8 - eth(14) - ipv4(20) - gre(16) = 65478
> 
> Do you think that it's worthwhile using the maximum possible MTU, or

I don't think it's worth possibly hitting another one of these issues.

> should we be a little conservative and use 65400 or 65000?  Either of
> those values would be future-proof, I think.

I agree 65000 would be okay, but if we're going to do it then lets do it
for everything (GENEVE/VXLAN/GRE) instead of assuming the kernel will
clamp the value for us on newlink/setlink.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH V2] rhel: Ensure proper OVS kernel modules load after upgrade

2018-01-16 Thread Gregory Rose

On 1/16/2018 10:15 AM, Flavio Leitner wrote:

On Tue, Jan 16, 2018 at 08:44:15AM -0800, Greg Rose wrote:

Add post install and post un-install scripts to make sure that the
openvswitch kernel modules are correctly written with the weak-modules
utility. This ensures that after an upgrade to a newer kernel the
correct openvswitch kernel modules from a previous installation will
be found by the depmod search path.

Suggested-by: Flavio Leitner 
Signed-off-by: Greg Rose 

---

LGTM, though I have not tested.

Acked-by: Flavio Leitner 



Thank you Flavio!

- Greg


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


Re: [ovs-dev] [PATCH V2] rhel: Ensure proper OVS kernel modules load after upgrade

2018-01-16 Thread Gregory Rose

On 1/16/2018 10:02 AM, Ansis Atteka wrote:

On 16 January 2018 at 08:44, Greg Rose  wrote:

Add post install and post un-install scripts to make sure that the
openvswitch kernel modules are correctly written with the weak-modules
utility. This ensures that after an upgrade to a newer kernel the
correct openvswitch kernel modules from a previous installation will
be found by the depmod search path.

Suggested-by: Flavio Leitner 
Signed-off-by: Greg Rose 

While I haven't tested your patch because ovs/master rhel spec files
are currently broken due to another issue, this patch looks sane to
me. Hence:

Acked-by: Ansis Atteka 

I will test it once I will get past other issues that prevent me from
building rpms on master branch.


Thanks!

- Greg




---
V2 - Modify the correct kmod spec file
---
  rhel/openvswitch-kmod-fedora.spec.in | 23 ++-
  1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/rhel/openvswitch-kmod-fedora.spec.in 
b/rhel/openvswitch-kmod-fedora.spec.in
index 93adb03..c0cd298 100644
--- a/rhel/openvswitch-kmod-fedora.spec.in
+++ b/rhel/openvswitch-kmod-fedora.spec.in
@@ -57,7 +57,28 @@ rm -rf $RPM_BUILD_ROOT

  %post
  # Ensure that modprobe will find our modules.
-depmod %{kernel}
+for k in $(cd /lib/modules && /bin/ls); do
+[ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k"
+done
+if [ -x "/sbin/weak-modules" ]; then
+for m in openvswitch vport-gre vport-stt vport-geneve \
+ vport-lisp vport-vxlan; do
+echo "/lib/modules/%{kernel}/extra/$m.ko"
+done | /sbin/weak-modules --add-modules
+fi
+
+%postun
+for k in $(cd /lib/modules && /bin/ls); do
+[ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k"
+done
+if [ "$1" = 0 ]; then  # Erase, not upgrade
+if [ -x "/sbin/weak-modules" ]; then
+for m in openvswitch vport-gre vport-stt vport-geneve \
+ vport-lisp vport-vxlan; do
+echo "/lib/modules/%{kernel}/extra/$m.ko"
+done | /sbin/weak-modules --remove-modules
+fi
+fi

  %files
  %defattr(0644,root,root)
--
1.8.3.1

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


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


Re: [ovs-dev] [PATCH V2] rhel: Ensure proper OVS kernel modules load after upgrade

2018-01-16 Thread Flavio Leitner
On Tue, Jan 16, 2018 at 08:44:15AM -0800, Greg Rose wrote:
> Add post install and post un-install scripts to make sure that the
> openvswitch kernel modules are correctly written with the weak-modules
> utility. This ensures that after an upgrade to a newer kernel the
> correct openvswitch kernel modules from a previous installation will
> be found by the depmod search path.
> 
> Suggested-by: Flavio Leitner 
> Signed-off-by: Greg Rose 
> 
> ---

LGTM, though I have not tested.

Acked-by: Flavio Leitner 


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


Re: [ovs-dev] [PATCH V2] rhel: Ensure proper OVS kernel modules load after upgrade

2018-01-16 Thread Ansis Atteka
On 16 January 2018 at 08:44, Greg Rose  wrote:
> Add post install and post un-install scripts to make sure that the
> openvswitch kernel modules are correctly written with the weak-modules
> utility. This ensures that after an upgrade to a newer kernel the
> correct openvswitch kernel modules from a previous installation will
> be found by the depmod search path.
>
> Suggested-by: Flavio Leitner 
> Signed-off-by: Greg Rose 

While I haven't tested your patch because ovs/master rhel spec files
are currently broken due to another issue, this patch looks sane to
me. Hence:

Acked-by: Ansis Atteka 

I will test it once I will get past other issues that prevent me from
building rpms on master branch.


>
> ---
> V2 - Modify the correct kmod spec file
> ---
>  rhel/openvswitch-kmod-fedora.spec.in | 23 ++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/rhel/openvswitch-kmod-fedora.spec.in 
> b/rhel/openvswitch-kmod-fedora.spec.in
> index 93adb03..c0cd298 100644
> --- a/rhel/openvswitch-kmod-fedora.spec.in
> +++ b/rhel/openvswitch-kmod-fedora.spec.in
> @@ -57,7 +57,28 @@ rm -rf $RPM_BUILD_ROOT
>
>  %post
>  # Ensure that modprobe will find our modules.
> -depmod %{kernel}
> +for k in $(cd /lib/modules && /bin/ls); do
> +[ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k"
> +done
> +if [ -x "/sbin/weak-modules" ]; then
> +for m in openvswitch vport-gre vport-stt vport-geneve \
> + vport-lisp vport-vxlan; do
> +echo "/lib/modules/%{kernel}/extra/$m.ko"
> +done | /sbin/weak-modules --add-modules
> +fi
> +
> +%postun
> +for k in $(cd /lib/modules && /bin/ls); do
> +[ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k"
> +done
> +if [ "$1" = 0 ]; then  # Erase, not upgrade
> +if [ -x "/sbin/weak-modules" ]; then
> +for m in openvswitch vport-gre vport-stt vport-geneve \
> + vport-lisp vport-vxlan; do
> +echo "/lib/modules/%{kernel}/extra/$m.ko"
> +done | /sbin/weak-modules --remove-modules
> +fi
> +fi
>
>  %files
>  %defattr(0644,root,root)
> --
> 1.8.3.1
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 2/3] ofp-util: New data structure for mapping between table names and numbers.

2018-01-16 Thread Yifeng Sun
It looks like that the not-null-validation of 'map' can be removed in
static function ofputil_name_map_destroy but should be added for
ofputil_port_map_destroy and ofputil_table_map_destroy.

Other than that, this patch looks good to me. Thanks.

Reviewed-by: Yifeng Sun 





On Fri, Jan 5, 2018 at 5:00 PM, Ben Pfaff  wrote:

> This shares the infrastructure for mapping port names and numbers.  It will
> be used in an upcoming commit.
>
> Signed-off-by: Ben Pfaff 
> ---
>  include/openvswitch/ofp-util.h |  33 +++--
>  lib/ofp-util.c | 150 ++
> ---
>  2 files changed, 138 insertions(+), 45 deletions(-)
>
> diff --git a/include/openvswitch/ofp-util.h b/include/openvswitch/ofp-
> util.h
> index a9e57ed5808d..84b1dbd2756b 100644
> --- a/include/openvswitch/ofp-util.h
> +++ b/include/openvswitch/ofp-util.h
> @@ -43,15 +43,24 @@ union ofp_action;
>  struct ofpact_set_field;
>  struct vl_mff_map;
>
> -/* Mapping between port numbers and names. */
> -struct ofputil_port_map {
> +/* Name-number mapping.
> + *
> + * This is not exported directly but only through specializations for port
> + * name-number and table name-number mappings. */
> +struct ofputil_name_map {
>  struct hmap by_name;
>  struct hmap by_number;
>  };
> -
> -#define OFPUTIL_PORT_MAP_INITIALIZER(MAP)  \
> +#define OFPUTIL_NAME_MAP_INITIALIZER(MAP)  \
>  { HMAP_INITIALIZER(&(MAP)->by_name), HMAP_INITIALIZER(&(MAP)->by_number)
> }
>
> +/* Mapping between port numbers and names. */
> +struct ofputil_port_map {
> +struct ofputil_name_map map;
> +};
> +#define OFPUTIL_PORT_MAP_INITIALIZER(MAP) \
> +{ OFPUTIL_NAME_MAP_INITIALIZER(&(MAP)->map) }
> +
>  void ofputil_port_map_init(struct ofputil_port_map *);
>  const char *ofputil_port_map_get_name(const struct ofputil_port_map *,
>ofp_port_t);
> @@ -791,6 +800,22 @@ struct ofputil_table_mod_prop_vacancy {
>  uint8_t vacancy; /* Current vacancy (%). */
>  };
>
> +/* Mapping between table numbers and names. */
> +struct ofputil_table_map {
> +struct ofputil_name_map map;
> +};
> +#define OFPUTIL_TABLE_MAP_INITIALIZER(MAP) \
> +{ OFPUTIL_NAME_MAP_INITIALIZER((MAP).map) }
> +
> +void ofputil_table_map_init(struct ofputil_table_map *);
> +const char *ofputil_table_map_get_name(const struct ofputil_table_map *,
> +   uint8_t);
> +uint8_t ofputil_table_map_get_number(const struct ofputil_table_map *,
> + const char *name);
> +void ofputil_table_map_put(struct ofputil_table_map *,
> +   uint8_t, const char *name);
> +void ofputil_table_map_destroy(struct ofputil_table_map *);
> +
>  /* Abstract ofp_table_mod. */
>  struct ofputil_table_mod {
>  uint8_t table_id; /* ID of the table, 0xff indicates all
> tables. */
> diff --git a/lib/ofp-util.c b/lib/ofp-util.c
> index 47f30c7716f3..43122ef09e5d 100644
> --- a/lib/ofp-util.c
> +++ b/lib/ofp-util.c
> @@ -7454,12 +7454,14 @@ ofputil_port_to_string(ofp_port_t port,
>  snprintf(namebuf, bufsize, "%"PRIu32, port);
>  }
>
> -/* ofputil_port_map.  */
> -struct ofputil_port_map_node {
> +/* ofputil_name_map.  */
> +
> +struct ofputil_name_map_node {
>  struct hmap_node name_node;
>  struct hmap_node number_node;
> -ofp_port_t ofp_port;/* Port number. */
> -char *name; /* Port name. */
> +
> +uint32_t number;
> +char *name;
>
>  /* OpenFlow doesn't require port names to be unique, although that's
> the
>   * only sensible way.  However, even in Open vSwitch it's possible
> for two
> @@ -7469,22 +7471,25 @@ struct ofputil_port_map_node {
>   * corner case.
>   *
>   * OpenFlow does require port numbers to be unique.  We check for
> duplicate
> - * ports numbers just in case a switch has a bug. */
> + * ports numbers just in case a switch has a bug.
> + *
> + * OpenFlow doesn't require table names to be unique and Open vSwitch
> + * doesn't try to make them unique. */
>  bool duplicate;
>  };
>
> -void
> -ofputil_port_map_init(struct ofputil_port_map *map)
> +static void
> +ofputil_name_map_init(struct ofputil_name_map *map)
>  {
>  hmap_init(>by_name);
>  hmap_init(>by_number);
>  }
>
> -static struct ofputil_port_map_node *
> -ofputil_port_map_find_by_name(const struct ofputil_port_map *map,
> +static struct ofputil_name_map_node *
> +ofputil_name_map_find_by_name(const struct ofputil_name_map *map,
>const char *name)
>  {
> -struct ofputil_port_map_node *node;
> +struct ofputil_name_map_node *node;
>
>  HMAP_FOR_EACH_WITH_HASH (node, name_node, hash_string(name, 0),
>   >by_name) {
> @@ -7495,38 +7500,38 @@ ofputil_port_map_find_by_name(const struct
> ofputil_port_map *map,
>  return NULL;
>  }
>
> 

Re: [ovs-dev] [PATCH] dpif-netlink-rtnl: Work around MTU bug in kernel GRE driver.

2018-01-16 Thread Ben Pfaff
On Tue, Jan 16, 2018 at 10:42:16AM -0500, Eric Garver wrote:
> On Fri, Jan 12, 2018 at 12:44:59PM -0800, Ben Pfaff wrote:
> > The kernel GRE driver ignores IFLA_MTU in RTM_NEWLINK requests and
> > overrides the MTU to 1472 bytes.  This commit works around the problem by
> > following up a request to create a GRE device with a second request to set
> > the MTU.
> > 
> > Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1488484
> > Reported-by: Eric Garver 
> > Reported-by: James Page 
> > Signed-off-by: Ben Pfaff 
> > ---
> > This is not properly tested.  It needs to be tested before it makes sense
> > to commit it.
> > 
> >  lib/dpif-netlink-rtnl.c | 13 +
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c
> > index fe9c8ed7104f..0bf965d29f41 100644
> > --- a/lib/dpif-netlink-rtnl.c
> > +++ b/lib/dpif-netlink-rtnl.c
> > @@ -329,6 +329,19 @@ dpif_netlink_rtnl_create(const struct 
> > netdev_tunnel_config *tnl_cfg,
> >  nl_msg_end_nested(, linkinfo_off);
> >  
> >  err = nl_transact(NETLINK_ROUTE, , NULL);
> > +if (!err && type == OVS_VPORT_TYPE_GRE) {
> > +/* Work around a bug in kernel GRE driver, which ignores IFLA_MTU 
> > in
> > + * RTM_NEWLINK, by setting the MTU again.  See
> > + * https://bugzilla.redhat.com/show_bug.cgi?id=1488484. */
> > +ofpbuf_clear();
> > +nl_msg_put_nlmsghdr(, 0, RTM_SETLINK,
> > +NLM_F_REQUEST | NLM_F_ACK);
> > +ofpbuf_put_zeros(, sizeof(struct ifinfomsg));
> > +nl_msg_put_string(, IFLA_IFNAME, name);
> > +nl_msg_put_u32(, IFLA_MTU, UINT16_MAX);
> 
> James' testing found that this value will be rejected by the kernel. GRE
> driver uses ip_tunnel_change_mtu() with the "strict" parameter, so it
> will return an error instead of clamping the value. GENEVE/VXLAN always
> clamp the value.
> 
> I think 65478 is the max_mtu for gretap accounting for optional csum,
> key, seq in gre_calc_hlen(). It may be slightly higher for how OVS
> configures gretap.
> 
>   0xFFF8 - eth(14) - ipv4(20) - gre(16) = 65478

Do you think that it's worthwhile using the maximum possible MTU, or
should we be a little conservative and use 65400 or 65000?  Either of
those values would be future-proof, I think.

Thanks,

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


Re: [ovs-dev] [PATCH 14/15] json: Make it safe to pass null pointers to json_equal().

2018-01-16 Thread Yifeng Sun
Looks good to me, thanks for the patch.

Reviewed-by: Yifeng Sun 

On Sun, Dec 31, 2017 at 9:16 PM, Ben Pfaff  wrote:

> Signed-off-by: Ben Pfaff 
> ---
>  lib/json.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/json.c b/lib/json.c
> index 5e93190b8a03..07ca87b2130f 100644
> --- a/lib/json.c
> +++ b/lib/json.c
> @@ -576,9 +576,9 @@ json_equal(const struct json *a, const struct json *b)
>  {
>  if (a == b) {
>  return true;
> -}
> -
> -if (a->type != b->type) {
> +} else if (!a || !b) {
> +return false;
> +} else if (a->type != b->type) {
>  return false;
>  }
>
> --
> 2.10.2
>
> ___
> 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 12/15] ovsdb-client: Add --timeout option.

2018-01-16 Thread Yifeng Sun
Looks good to me, thanks.

Reviewed-by: Yifeng Sun 

On Sun, Dec 31, 2017 at 9:16 PM, Ben Pfaff  wrote:

> Signed-off-by: Ben Pfaff 
> ---
>  NEWS|  1 +
>  ovsdb/ovsdb-client.1.in |  6 ++
>  ovsdb/ovsdb-client.c| 12 
>  tests/ovs-macros.at |  4 
>  4 files changed, 23 insertions(+)
>
> diff --git a/NEWS b/NEWS
> index dfc2fb7728a4..646879c61677 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -11,6 +11,7 @@ Post-v2.8.0
> ovsdb-server(5) for more details.
>   * ovsdb-client: New "get-schema-cksum" and "query" commands.
>   * ovsdb-client: New "backup" and "restore" commands.
> + * ovsdb-client: New --timeout option.
>   * ovsdb-tool: New "db-name" and "schema-name" commands.
> - ovs-vsctl and other commands that display data in tables now support
> a
>   --max-column-width option to limit column width.
> diff --git a/ovsdb/ovsdb-client.1.in b/ovsdb/ovsdb-client.1.in
> index 56d4797e933c..727e9c6e0651 100644
> --- a/ovsdb/ovsdb-client.1.in
> +++ b/ovsdb/ovsdb-client.1.in
> @@ -313,6 +313,12 @@ table update.  Most output formats add the timestamp
> on a line of its own
>  just above the table.  The JSON output format puts the timestamp in a
>  member of the top-level JSON object named \fBtime\fR.
>  .
> +.IP "\fB\-t\fR"
> +.IQ "\fB\-\-timeout=\fIsecs\fR"
> +Limits \fBovsdb\-client\fR runtime to approximately \fIsecs\fR
> +seconds.  If the timeout expires, \fBovsdb\-client\fR will exit with a
> +\fBSIGALRM\fR signal.
> +.
>  .SS "Daemon Options"
>  The daemon options apply only to the \fBmonitor\fR and
> \fBmonitor\-cond\fR commands.
>  With any other command, they have no effect.
> diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c
> index a7cab600c98b..b00f04147d39 100644
> --- a/ovsdb/ovsdb-client.c
> +++ b/ovsdb/ovsdb-client.c
> @@ -213,6 +213,7 @@ parse_options(int argc, char *argv[])
>  {"force", no_argument, NULL, OPT_FORCE},
>  {"db-change-aware", no_argument, _change_aware, 1},
>  {"no-db-change-aware", no_argument, _change_aware, 0},
> +{"timeout", required_argument, NULL, 't'},
>  VLOG_LONG_OPTIONS,
>  DAEMON_LONG_OPTIONS,
>  #ifdef HAVE_OPENSSL
> @@ -227,6 +228,7 @@ parse_options(int argc, char *argv[])
>  table_style.format = TF_TABLE;
>
>  for (;;) {
> +unsigned long int timeout;
>  int c;
>
>  c = getopt_long(argc, argv, short_options, long_options, NULL);
> @@ -259,6 +261,16 @@ parse_options(int argc, char *argv[])
>  force = true;
>  break;
>
> +case 't':
> +timeout = strtoul(optarg, NULL, 10);
> +if (timeout <= 0) {
> +ovs_fatal(0, "value %s on -t or --timeout is not at least
> 1",
> +  optarg);
> +} else {
> +time_alarm(timeout);
> +}
> +break;
> +
>  case '?':
>  exit(EXIT_FAILURE);
>
> diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at
> index 56d0a3bca86d..82df193871b3 100644
> --- a/tests/ovs-macros.at
> +++ b/tests/ovs-macros.at
> @@ -122,6 +122,7 @@ if [ $? -eq 0 ]; then
>  alias ovn-sbctl='OVS_SBCTL_TIMEOUT'
>  alias ovn-nbctl='OVN_NBCTL_TIMEOUT'
>  alias vtep-ctl='VTEP_CTL_TIMEOUT'
> +alias ovsdb-client='OVSDB_CLIENT_TIMEOUT'
>  OVS_OFCTL_TIMEOUT () {
>  command ovs-ofctl --timeout=$OVS_TIMEOUT "$@"
>  }
> @@ -137,6 +138,9 @@ if [ $? -eq 0 ]; then
>  VTEP_CTL_TIMEOUT () {
>  command vtep-ctl --timeout=$OVS_TIMEOUT "$@"
>  }
> +OVSDB_CLIENT_TIMEOUT () {
> +command ovsdb-client --timeout=$OVS_TIMEOUT "$@"
> +}
>  fi
>
>  # parent_pid PID
> --
> 2.10.2
>
> ___
> 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 v3 0/3] Add dpif support for ct_clear action

2018-01-16 Thread Eric Garver
On Sat, Nov 18, 2017 at 07:41:43PM -0500, Eric Garver wrote:
> This series adds dpif support for OVS_ACTION_ATTR_CT_CLEAR. Previously the
> ct_clear action was a userspace only operation, but it has use cases in the
> dpif as well. Namely changing a packet's tuple after a ct() lookup has
> occurred.
> 
> Kernel support has already be accepted upstream:
>   b8226962b1c4 ("openvswitch: add ct_clear action").
> 
> travis-ci: https://travis-ci.org/erig0/ovs/builds/290487503
> 
> v3:
> - add NEWS item
> - add comment describing OVS_ACTION_ATTR_CT_CLEAR
> - update parse_odp_action() and add ct_clear to odp test case
> v2:
> - Specify port for nc in test (patch 3)
> 
> Eric Garver (3):
>   dpif: Add support for OVS_ACTION_ATTR_CT_CLEAR
>   system-common-macros: Check for ct_clear action in datapath
>   system-traffic: Add conntrack floating IP test
> 
>  NEWS  |  3 +
>  datapath/linux/compat/include/linux/openvswitch.h |  2 +
>  lib/conntrack.c   | 10 
>  lib/conntrack.h   |  1 +
>  lib/dpif-netdev.c |  1 +
>  lib/dpif.c|  1 +
>  lib/odp-execute.c |  7 +++
>  lib/odp-util.c| 11 
>  lib/ofp-actions.c |  1 +
>  ofproto/ofproto-dpif-ipfix.c  |  1 +
>  ofproto/ofproto-dpif-sflow.c  |  1 +
>  ofproto/ofproto-dpif-xlate.c  | 14 -
>  ofproto/ofproto-dpif.c| 32 ++
>  ofproto/ofproto-dpif.h|  5 +-
>  tests/odp.at  |  1 +
>  tests/system-common-macros.at |  4 ++
>  tests/system-traffic.at   | 73 
> +++
>  17 files changed, 166 insertions(+), 2 deletions(-)
> 
> -- 
> 2.12.0

Hi Ben, Justin,

This series has been ACKd for awhile. Can it be applied?
I can quickly rebase if needed.

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


Re: [ovs-dev] [PATCH] Drop support for RHEL 5 and 6

2018-01-16 Thread Russell Bryant
On Thu, Jan 11, 2018 at 11:36 AM, Timothy Redaelli  wrote:
> RHEL 6 is not supported anymore since it uses Python 2.6 and GCC 4.4.x,
> but Open vSwitch needs, at least, Python 2.7 and GCC 4.6 to build correctly.
>
> http://docs.openvswitch.org/en/latest/intro/install/general/#build-requirements
>
> CC: Gurucharan Shetty 
> Signed-off-by: Timothy Redaelli 

Acked-by: Russell Bryant 

I'm fine with this, but I'll let Guru comment as well before applying anything.

> ---
>
> This is the same, rejected, patch I sent as RFC since I have, in the
> meanwhile, sent another patchset (already merged) to add the requested
> "force-reload-kmod" support on RHEL7 ("ovs-systemd-reload force-reload-kmod").
>
>  Documentation/automake.mk |   1 -
>  Documentation/howto/docker.rst|   2 +-
>  Documentation/index.rst   |   1 -
>  Documentation/intro/install/index.rst |   1 -
>  Documentation/intro/install/rhel.rst  | 238 --
>  rhel/.gitignore   |   3 -
>  rhel/automake.mk  |  11 --
>  rhel/openvswitch-kmod-rhel6.spec.in   |  78 --
>  rhel/openvswitch-kmod.files   |   3 -
>  rhel/openvswitch.spec.in  | 267 
> --
>  10 files changed, 1 insertion(+), 604 deletions(-)
>  delete mode 100644 Documentation/intro/install/rhel.rst
>  delete mode 100644 rhel/openvswitch-kmod-rhel6.spec.in
>  delete mode 100644 rhel/openvswitch-kmod.files
>  delete mode 100644 rhel/openvswitch.spec.in
>
> diff --git a/Documentation/automake.mk b/Documentation/automake.mk
> index 2b202cb2a..e614b9de1 100644
> --- a/Documentation/automake.mk
> +++ b/Documentation/automake.mk
> @@ -18,7 +18,6 @@ DOC_SOURCE = \
> Documentation/intro/install/general.rst \
> Documentation/intro/install/netbsd.rst \
> Documentation/intro/install/ovn-upgrades.rst \
> -   Documentation/intro/install/rhel.rst \
> Documentation/intro/install/userspace.rst \
> Documentation/intro/install/windows.rst \
> Documentation/intro/install/xenserver.rst \
> diff --git a/Documentation/howto/docker.rst b/Documentation/howto/docker.rst
> index ff8b708af..c3d4dbf20 100644
> --- a/Documentation/howto/docker.rst
> +++ b/Documentation/howto/docker.rst
> @@ -296,7 +296,7 @@ The "underlay" mode
> Depending on your VM, you can make the above step persistent across 
> reboots.
> For example, if your VM is Debian/Ubuntu-based, read
> `openvswitch-switch.README.Debian` found in `debian` folder. If your VM is
> -   RHEL-based, refer to :doc:`/intro/install/rhel`.
> +   Fedora/RHEL7/CentOS7-based, refer to :doc:`/intro/install/fedora`.
>
>  3. Start the Open vSwitch network driver
>
> diff --git a/Documentation/index.rst b/Documentation/index.rst
> index ddffa3a62..dac14ba58 100644
> --- a/Documentation/index.rst
> +++ b/Documentation/index.rst
> @@ -86,7 +86,6 @@ Deeper Dive
>  - **Testing** :doc:`topics/testing`
>
>  - **Packaging:** :doc:`intro/install/debian` |
> -  :doc:`intro/install/rhel` |
>:doc:`intro/install/fedora`
>
>  The Open vSwitch Project
> diff --git a/Documentation/intro/install/index.rst 
> b/Documentation/intro/install/index.rst
> index 3193c736c..626b49f12 100644
> --- a/Documentation/intro/install/index.rst
> +++ b/Documentation/intro/install/index.rst
> @@ -59,7 +59,6 @@ provided below.
> distributions
> debian
> fedora
> -   rhel
>
>  Upgrades
>  
> diff --git a/Documentation/intro/install/rhel.rst 
> b/Documentation/intro/install/rhel.rst
> deleted file mode 100644
> index f8b26069f..0
> --- a/Documentation/intro/install/rhel.rst
> +++ /dev/null
> @@ -1,238 +0,0 @@
> -..
> -  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.
> -
> -  Convention for heading levels in Open vSwitch documentation:
> -
> -  ===  Heading 0 (reserved for the title in a document)
> -  ---  Heading 1
> -  ~~~  Heading 2
> -  +++  Heading 3
> -  '''  Heading 4
> -
> -  Avoid deeper levels because they do not render well.
> -
> -
> -RHEL 5.6, 6.x Packaging for Open vSwitch
> -
> -
> -This document describes how to build and install Open vSwitch on a Red Hat
> -Enterprise Linux (RHEL) host.  If you want to 

[ovs-dev] [PATCH V2] rhel: Ensure proper OVS kernel modules load after upgrade

2018-01-16 Thread Greg Rose
Add post install and post un-install scripts to make sure that the
openvswitch kernel modules are correctly written with the weak-modules
utility. This ensures that after an upgrade to a newer kernel the
correct openvswitch kernel modules from a previous installation will
be found by the depmod search path.

Suggested-by: Flavio Leitner 
Signed-off-by: Greg Rose 

---
V2 - Modify the correct kmod spec file
---
 rhel/openvswitch-kmod-fedora.spec.in | 23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/rhel/openvswitch-kmod-fedora.spec.in 
b/rhel/openvswitch-kmod-fedora.spec.in
index 93adb03..c0cd298 100644
--- a/rhel/openvswitch-kmod-fedora.spec.in
+++ b/rhel/openvswitch-kmod-fedora.spec.in
@@ -57,7 +57,28 @@ rm -rf $RPM_BUILD_ROOT
 
 %post
 # Ensure that modprobe will find our modules.
-depmod %{kernel}
+for k in $(cd /lib/modules && /bin/ls); do
+[ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k"
+done
+if [ -x "/sbin/weak-modules" ]; then
+for m in openvswitch vport-gre vport-stt vport-geneve \
+ vport-lisp vport-vxlan; do
+echo "/lib/modules/%{kernel}/extra/$m.ko"
+done | /sbin/weak-modules --add-modules
+fi
+
+%postun
+for k in $(cd /lib/modules && /bin/ls); do
+[ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k"
+done
+if [ "$1" = 0 ]; then  # Erase, not upgrade
+if [ -x "/sbin/weak-modules" ]; then
+for m in openvswitch vport-gre vport-stt vport-geneve \
+ vport-lisp vport-vxlan; do
+echo "/lib/modules/%{kernel}/extra/$m.ko"
+done | /sbin/weak-modules --remove-modules
+fi
+fi
 
 %files
 %defattr(0644,root,root)
-- 
1.8.3.1

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


Re: [ovs-dev] [PATCH] dpif-netlink-rtnl: Work around MTU bug in kernel GRE driver.

2018-01-16 Thread Eric Garver
On Fri, Jan 12, 2018 at 12:44:59PM -0800, Ben Pfaff wrote:
> The kernel GRE driver ignores IFLA_MTU in RTM_NEWLINK requests and
> overrides the MTU to 1472 bytes.  This commit works around the problem by
> following up a request to create a GRE device with a second request to set
> the MTU.
> 
> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1488484
> Reported-by: Eric Garver 
> Reported-by: James Page 
> Signed-off-by: Ben Pfaff 
> ---
> This is not properly tested.  It needs to be tested before it makes sense
> to commit it.
> 
>  lib/dpif-netlink-rtnl.c | 13 +
>  1 file changed, 13 insertions(+)
> 
> diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c
> index fe9c8ed7104f..0bf965d29f41 100644
> --- a/lib/dpif-netlink-rtnl.c
> +++ b/lib/dpif-netlink-rtnl.c
> @@ -329,6 +329,19 @@ dpif_netlink_rtnl_create(const struct 
> netdev_tunnel_config *tnl_cfg,
>  nl_msg_end_nested(, linkinfo_off);
>  
>  err = nl_transact(NETLINK_ROUTE, , NULL);
> +if (!err && type == OVS_VPORT_TYPE_GRE) {
> +/* Work around a bug in kernel GRE driver, which ignores IFLA_MTU in
> + * RTM_NEWLINK, by setting the MTU again.  See
> + * https://bugzilla.redhat.com/show_bug.cgi?id=1488484. */
> +ofpbuf_clear();
> +nl_msg_put_nlmsghdr(, 0, RTM_SETLINK,
> +NLM_F_REQUEST | NLM_F_ACK);
> +ofpbuf_put_zeros(, sizeof(struct ifinfomsg));
> +nl_msg_put_string(, IFLA_IFNAME, name);
> +nl_msg_put_u32(, IFLA_MTU, UINT16_MAX);

James' testing found that this value will be rejected by the kernel. GRE
driver uses ip_tunnel_change_mtu() with the "strict" parameter, so it
will return an error instead of clamping the value. GENEVE/VXLAN always
clamp the value.

I think 65478 is the max_mtu for gretap accounting for optional csum,
key, seq in gre_calc_hlen(). It may be slightly higher for how OVS
configures gretap.

  0xFFF8 - eth(14) - ipv4(20) - gre(16) = 65478

> +
> +err = nl_transact(NETLINK_ROUTE, , NULL);
> +}
>  
>  exit:
>  ofpbuf_uninit();
> -- 
> 2.10.2
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v7 3/3] dpif-netdev: Detection and logging of suspicious PMD iterations

2018-01-16 Thread Jan Scheurich
This patch enhances dpif-netdev-perf to detect iterations with
suspicious statistics according to the following criteria:

- iteration lasts longer than US_THR microseconds (default 250).
  This can be used to capture events where a PMD is blocked or
  interrupted for such a period of time that there is a risk for
  dropped packets on any of its Rx queues.

- max vhost qlen exceeds a threshold Q_THR (default 128). This can
  be used to infer virtio queue overruns and dropped packets inside
  a VM, which are not visible in OVS otherwise.

Such suspicious iterations can be logged together with their iteration
statistics to be able to correlate them to packet drop or other events
outside OVS.

A new command is introduced to enable/disable logging at run-time and
to adjust the above thresholds for suspicious iterations:

ovs-appctl dpif-netdev/pmd-perf-log-set on | off
[-b before] [-a after] [-us usec] [-q qlen]

Turn logging on or off at run-time (on|off).

-b before:  The number of iterations before the suspicious iteration to
be logged (default 5).
-a after:   The number of iterations after the suspicious iteration to
be logged (default 5).
-q qlen:Suspicious vhost queue fill level threshold. Increase this
to 512 if the Qemu supports 1024 virtio queue length.
(default 128).
-us usec:   change the duration threshold for a suspicious iteration
(default 250 us).

If more than 100 iterations before or after a suspicious iteration have
been looged once, OVS falls back to the safe default values (5/5) to
avoid that logging itself causes continuos further logging.

Signed-off-by: Jan Scheurich 
---
 NEWS|   2 +
 lib/dpif-netdev-perf.c  | 142 
 lib/dpif-netdev-perf.h  |  40 -
 lib/dpif-netdev.c   |   7 ++-
 lib/netdev-dpif-unixctl.man |  47 ++-
 5 files changed, 233 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index 743528e..7d40374 100644
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,8 @@ Post-v2.8.0
  * Commands ovs-appctl dpif-netdev/pmd-*-show can now work on a single PMD
  * Detailed PMD performance metrics available with new command
  ovs-appctl dpif-netdev/pmd-perf-show
+ * Supervision of PMD performance metrics and logging of suspicious
+   iterations
- vswitchd:
  * Datapath IDs may now be specified as 0x1 (etc.) instead of 16 digits.
  * Configuring a controller, or unconfiguring all controllers, now deletes
diff --git a/lib/dpif-netdev-perf.c b/lib/dpif-netdev-perf.c
index e0ef15d..259a6c8 100644
--- a/lib/dpif-netdev-perf.c
+++ b/lib/dpif-netdev-perf.c
@@ -24,6 +24,23 @@
 
 VLOG_DEFINE_THIS_MODULE(pmd_perf);
 
+#define ITER_US_THRESHOLD 250   /* Warning threshold for iteration duration
+   in microseconds. */
+#define VHOST_QUEUE_FULL 128/* Size of the virtio TX queue. */
+#define LOG_IT_BEFORE 5 /* Number of iteration to log before
+   suspicious iteration. */
+#define LOG_IT_AFTER 5  /* Number of iteration to log after
+   suspicious iteration. */
+
+bool log_on = false;
+static uint32_t log_it_before = LOG_IT_BEFORE;
+static uint32_t log_it_after = LOG_IT_AFTER;
+static uint32_t log_us_thr = ITER_US_THRESHOLD;
+uint32_t log_q_thr = VHOST_QUEUE_FULL;
+uint64_t iter_cycle_threshold;
+
+static struct vlog_rate_limit latency_rl = VLOG_RATE_LIMIT_INIT(600, 600);
+
 #ifdef DPDK_NETDEV
 static uint64_t
 get_tsc_hz(void)
@@ -124,6 +141,8 @@ pmd_perf_stats_init(struct pmd_perf_stats *s)
 histogram_walls_set_log(>cycles_per_upcall, 1000, 100);
 histogram_walls_set_log(>max_vhost_qfill, 0, 512);
 s->start_ms = time_msec();
+s->log_begin_it = UINT64_MAX;
+s->log_end_it = UINT64_MAX;
 }
 
 void
@@ -362,6 +381,8 @@ pmd_perf_stats_clear__(struct pmd_perf_stats *s)
 history_init(>milliseconds);
 s->start_ms = time_msec();
 s->milliseconds.sample[0].timestamp = s->start_ms;
+s->log_begin_it = UINT64_MAX;
+s->log_end_it = UINT64_MAX;
 /* Clearing finished. */
 s->clear = false;
 }
@@ -387,3 +408,124 @@ non_pmd_perf_stats_clear(struct pmd_perf_stats *s)
 {
 pmd_perf_stats_clear__(s);
 }
+
+void
+pmd_perf_log_suspicious_iteration(struct pmd_perf_stats *s,
+ uint64_t cycles,
+ char *reason)
+{
+VLOG_WARN_RL(_rl,
+ "Suspicious iteration (%s): tsc=%"PRIu64
+ " duration=%"PRIu64" us\n",
+ reason, s->current.timestamp,
+ (100L * cycles) / get_tsc_hz());
+if (log_it_before + log_it_after > 0) {
+if (s->log_begin_it == UINT64_MAX) {
+s->log_begin_it =
+(s->iterations.idx + HISTORY_LEN - log_it_before)
+% 

[ovs-dev] [PATCH v7 2/3] dpif-netdev: Detailed performance stats for PMDs

2018-01-16 Thread Jan Scheurich
This patch instruments the dpif-netdev datapath to record detailed
statistics of what is happening in every iteration of a PMD thread.

The collection of detailed statistics can be controlled by a new
Open_vSwitch configuration parameter "other_config:pmd-perf-metrics".
By default it is disabled. The run-time overhead, when enabled, is
in the order of 1%.

The covered metrics per iteration are:
  - cycles
  - packets
  - (rx) batches
  - packets/batch
  - max. vhostuser qlen
  - upcalls
  - cycles spent in upcalls

This raw recorded data is used threefold:

1. In histograms for each of the following metrics:
   - cycles/iteration (log.)
   - packets/iteration (log.)
   - cycles/packet
   - packets/batch
   - max. vhostuser qlen (log.)
   - upcalls
   - cycles/upcall (log)
   The histograms bins are divided linear or logarithmic.

2. A cyclic history of the above statistics for 999 iterations

3. A cyclic history of the cummulative/average values per millisecond
   wall clock for the last 1000 milliseconds:
   - number of iterations
   - avg. cycles/iteration
   - packets (Kpps)
   - avg. packets/batch
   - avg. max vhost qlen
   - upcalls
   - avg. cycles/upcall

The gathered performance metrics can be printed at any time with the
new CLI command

ovs-appctl dpif-netdev/pmd-perf-show [-nh] [-it iter_len] [-ms ms_len]
[-pmd core | dp]

The options are

-nh:Suppress the histograms
-it iter_len:   Display the last iter_len iteration stats
-ms ms_len: Display the last ms_len millisecond stats
-pmd core:  Display only

The performance statistics are reset with the existing
dpif-netdev/pmd-stats-clear command.

The output always contains the following global PMD statistics,
similar to the pmd-stats-show command:

Time: 15:24:55.270
Measurement duration: 1.008 s

pmd thread numa_id 0 core_id 1:

  Cycles:2419034712  (2.40 GHz)
  Iterations:572817  (1.76 us/it)
  - idle:486808  (15.9 % cycles)
  - busy: 86009  (84.1 % cycles)
  Packets:  2399607  (2381 Kpps, 848 cycles/pkt)
  Datapath passes:  3599415  (1.50 passes/pkt)
  - EMC hits:336472  ( 9.3 %)
  - Megaflow hits:  3262943  (90.7 %, 1.00 subtbl lookups/hit)
  - Upcalls:  0  ( 0.0 %, 0.0 us/upcall)
  - Lost upcalls: 0  ( 0.0 %)

Signed-off-by: Jan Scheurich 
---
 NEWS|   3 +
 lib/automake.mk |   1 +
 lib/dp-packet.h |   1 +
 lib/dpif-netdev-perf.c  | 333 +++-
 lib/dpif-netdev-perf.h  | 239 +--
 lib/dpif-netdev.c   | 177 +--
 lib/netdev-dpdk.c   |  13 +-
 lib/netdev-dpdk.h   |  14 ++
 lib/netdev-dpif-unixctl.man | 113 +++
 manpages.mk |   2 +
 vswitchd/ovs-vswitchd.8.in  |  27 +---
 vswitchd/vswitch.xml|  12 ++
 12 files changed, 881 insertions(+), 54 deletions(-)
 create mode 100644 lib/netdev-dpif-unixctl.man

diff --git a/NEWS b/NEWS
index 2c28456..743528e 100644
--- a/NEWS
+++ b/NEWS
@@ -44,6 +44,9 @@ Post-v2.8.0
   if available (for OpenFlow 1.4+).
- Userspace datapath:
  * Output packet batching support.
+ * Commands ovs-appctl dpif-netdev/pmd-*-show can now work on a single PMD
+ * Detailed PMD performance metrics available with new command
+ ovs-appctl dpif-netdev/pmd-perf-show
- vswitchd:
  * Datapath IDs may now be specified as 0x1 (etc.) instead of 16 digits.
  * Configuring a controller, or unconfiguring all controllers, now deletes
diff --git a/lib/automake.mk b/lib/automake.mk
index 159319f..d07cbe9 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -468,6 +468,7 @@ MAN_FRAGMENTS += \
lib/dpctl.man \
lib/memory-unixctl.man \
lib/netdev-dpdk-unixctl.man \
+   lib/netdev-dpif-unixctl.man \
lib/ofp-version.man \
lib/ovs.tmac \
lib/service.man \
diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index b4b721c..3d65088 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -697,6 +697,7 @@ struct dp_packet_batch {
 size_t count;
 bool trunc; /* true if the batch needs truncate. */
 struct dp_packet *packets[NETDEV_MAX_BURST];
+
 };
 
 static inline void
diff --git a/lib/dpif-netdev-perf.c b/lib/dpif-netdev-perf.c
index f06991a..e0ef15d 100644
--- a/lib/dpif-netdev-perf.c
+++ b/lib/dpif-netdev-perf.c
@@ -15,6 +15,7 @@
  */
 
 #include 
+#include 
 
 #include "openvswitch/dynamic-string.h"
 #include "openvswitch/vlog.h"
@@ -23,10 +24,299 @@
 
 VLOG_DEFINE_THIS_MODULE(pmd_perf);
 
+#ifdef DPDK_NETDEV
+static uint64_t
+get_tsc_hz(void)
+{
+return rte_get_tsc_hz();
+}
+#else
+/* This function is only invoked from PMD threads which depend on DPDK.
+ * A dummy function is sufficient when building without DPDK_NETDEV. */
+static uint64_t
+get_tsc_hz(void)
+{
+return 1;
+}
+#endif
+

[ovs-dev] [PATCH v7 1/3] netdev: Add rxq callback function rxq_length()

2018-01-16 Thread Jan Scheurich
If implememented, this function returns the number of packets in an rx
queue of the netdev. If not implemented, it returns -1.

This function will be used in the upcoming commit for PMD performance
metrics to supervise the rx queue fill level for DPDK vhostuser ports.

Signed-off-by: Jan Scheurich 
---
 lib/netdev-bsd.c  |  1 +
 lib/netdev-dpdk.c | 36 +++-
 lib/netdev-dummy.c|  1 +
 lib/netdev-linux.c|  1 +
 lib/netdev-provider.h |  3 +++
 lib/netdev-vport.c|  1 +
 lib/netdev.c  |  9 +
 lib/netdev.h  |  1 +
 8 files changed, 48 insertions(+), 5 deletions(-)

diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c
index 05974c1..8d1771e 100644
--- a/lib/netdev-bsd.c
+++ b/lib/netdev-bsd.c
@@ -1546,6 +1546,7 @@ netdev_bsd_update_flags(struct netdev *netdev_, enum 
netdev_flags off,
 netdev_bsd_rxq_recv, \
 netdev_bsd_rxq_wait, \
 netdev_bsd_rxq_drain,\
+NULL, /* rxq_length */   \
  \
 NO_OFFLOAD_API   \
 }
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index ccda3fc..4200556 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1839,6 +1839,27 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq, struct 
dp_packet_batch *batch)
 return 0;
 }
 
+static int
+netdev_dpdk_vhost_rxq_length(struct netdev_rxq *rxq)
+{
+struct netdev_dpdk *dev = netdev_dpdk_cast(rxq->netdev);
+int qid = rxq->queue_id;
+
+/* The DPDK API returns a uint32_t which often has invalid bits in the
+ * upper 16-bits. Need to restrict the value uint16_t. */
+return rte_vhost_rx_queue_count(netdev_dpdk_get_vid(dev),
+qid * VIRTIO_QNUM + VIRTIO_TXQ)
+& UINT16_MAX;
+}
+
+static int
+netdev_dpdk_rxq_length(struct netdev_rxq *rxq)
+{
+struct netdev_rxq_dpdk *rx = netdev_rxq_dpdk_cast(rxq);
+
+return rte_eth_rx_queue_count(rx->port_id, rxq->queue_id);
+}
+
 static inline int
 netdev_dpdk_qos_run(struct netdev_dpdk *dev, struct rte_mbuf **pkts,
 int cnt, bool may_steal)
@@ -3580,7 +3601,7 @@ unlock:
   GET_CARRIER, GET_STATS,\
   GET_CUSTOM_STATS,
  \
   GET_FEATURES, GET_STATUS,   \
-  RECONFIGURE, RXQ_RECV)  \
+  RECONFIGURE, RXQ_RECV, RXQ_LENGTH)  \
 { \
 NAME, \
 true,   /* is_pmd */  \
@@ -3649,6 +3670,7 @@ unlock:
 RXQ_RECV, \
 NULL,   /* rx_wait */ \
 NULL,   /* rxq_drain */   \
+RXQ_LENGTH,   \
 NO_OFFLOAD_API\
 }
 
@@ -3667,7 +3689,8 @@ static const struct netdev_class dpdk_class =
 netdev_dpdk_get_features,
 netdev_dpdk_get_status,
 netdev_dpdk_reconfigure,
-netdev_dpdk_rxq_recv);
+netdev_dpdk_rxq_recv,
+netdev_dpdk_rxq_length);
 
 static const struct netdev_class dpdk_ring_class =
 NETDEV_DPDK_CLASS(
@@ -3684,7 +3707,8 @@ static const struct netdev_class dpdk_ring_class =
 netdev_dpdk_get_features,
 netdev_dpdk_get_status,
 netdev_dpdk_reconfigure,
-netdev_dpdk_rxq_recv);
+netdev_dpdk_rxq_recv,
+NULL);
 
 static const struct netdev_class dpdk_vhost_class =
 NETDEV_DPDK_CLASS(
@@ -3701,7 +3725,8 @@ static const struct netdev_class dpdk_vhost_class =
 NULL,
 NULL,
 netdev_dpdk_vhost_reconfigure,
-netdev_dpdk_vhost_rxq_recv);
+netdev_dpdk_vhost_rxq_recv,
+netdev_dpdk_vhost_rxq_length);
 static const struct netdev_class dpdk_vhost_client_class =
 NETDEV_DPDK_CLASS(
 "dpdkvhostuserclient",
@@ -3717,7 +3742,8 @@ static const struct netdev_class dpdk_vhost_client_class =
 NULL,
 NULL,
 netdev_dpdk_vhost_client_reconfigure,
-netdev_dpdk_vhost_rxq_recv);
+netdev_dpdk_vhost_rxq_recv,
+netdev_dpdk_vhost_rxq_length);
 
 void
 netdev_dpdk_register(void)
diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index 4246af3..7e2c0a2 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -1457,6 +1457,7 @@ netdev_dummy_update_flags(struct netdev *netdev_,
 netdev_dummy_rxq_recv,  \
 netdev_dummy_rxq_wait,  \
 netdev_dummy_rxq_drain, \
+NULL,

[ovs-dev] [PATCH v7 0/3] dpif-netdev: Detailed PMD performance metrics and supervision

2018-01-16 Thread Jan Scheurich
The run-time performance of PMDs is often difficult to understand and 
trouble-shoot. The existing PMD statistics counters only provide a coarse 
grained average picture. At packet rates of several Mpps sporadic drops of
packet bursts happen at sub-millisecond time scales and are impossible to
capture and analyze with existing tools.

This patch collects a large number of important PMD performance metrics
per PMD iteration, maintaining histograms and circular histories for
iteration metrics and millisecond averages. To capture sporadic drop
events, the patch set can be configured to monitor iterations for suspicious
metrics and to log the neighborhood of such iterations for off-line analysis.

The extra cost for the performance metric collection and the supervision has
been measured to be in the order of 1% compared to the base commit in a PVP
setup with L3 pipeline over VXLAN tunnels. For that reason the metrics
collection is disabled by default and can be enabled at run-time through
configuration.

v5 -> v7:
* Rebased on to dpdk_merge (commit e68)
  - New base contains earlier refactoring parts of series.
* Implemented comments from Ilya Maximets and Billy O'Mahony.
* Replaced piggybacking qlen on dp_packet_batch with a new netdev API
  netdev_rxq_length().
* Thread-safe clearing of pmd counters in pmd_perf_start_iteration().
* Fixed bug in reporting datapath stats.
* Work-around a bug in DPDK rte_vhost_rx_queue_count() which sometimes
  returns bogus in the upper 16 bits of the uint32_t return value.

v4 -> v5:
* Rebased to master (commit e9de6c0)
* Implemented comments from Aaron Conole and Darrel Ball

v3 -> v4:
* Rebased to master (commit 4d0a31b)
  - Reverting changes to struct dp_netdev_pmd_thread.
* Make metrics collection configurable.
* Several bugfixes.

v2 -> v3:
* Rebased to OVS master (commit 3728b3b).
* Non-trivial adaptation to struct dp_netdev_pmd_thread.
  - refactored in commit a807c157 (Bhanu).
* No other changes compared to v2.

v1 -> v2:
* Rebased to OVS master (commit 7468ec788).
* No other changes compared to v1.


Jan Scheurich (3):
  netdev: Add rxq callback function rxq_length()
  dpif-netdev: Detailed performance stats for PMDs
  dpif-netdev: Detection and logging of suspicious PMD iterations

 NEWS|   5 +
 lib/automake.mk |   1 +
 lib/dp-packet.h |   1 +
 lib/dpif-netdev-perf.c  | 475 +++-
 lib/dpif-netdev-perf.h  | 275 -
 lib/dpif-netdev.c   | 184 +++--
 lib/netdev-bsd.c|   1 +
 lib/netdev-dpdk.c   |  49 -
 lib/netdev-dpdk.h   |  14 ++
 lib/netdev-dpif-unixctl.man | 156 +++
 lib/netdev-dummy.c  |   1 +
 lib/netdev-linux.c  |   1 +
 lib/netdev-provider.h   |   3 +
 lib/netdev-vport.c  |   1 +
 lib/netdev.c|   9 +
 lib/netdev.h|   1 +
 manpages.mk |   2 +
 vswitchd/ovs-vswitchd.8.in  |  27 +--
 vswitchd/vswitch.xml|  12 ++
 19 files changed, 1158 insertions(+), 60 deletions(-)
 create mode 100644 lib/netdev-dpif-unixctl.man

-- 
1.9.1

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


[ovs-dev] [PATCH v4 2/2] NEWS: Add entry for new appctl dpif-netdev/pmd-rxq-rebalance.

2018-01-16 Thread Kevin Traynor
This feature was added earlier but we thought it better to
advertise in NEWS after there was stats provided to help
the user decide whether they should use it.

Signed-off-by: Kevin Traynor 
---

V4:
- No change.

V3:
- Rebased to DPDK_MERGE branch.

V2:
- Newly added.


 NEWS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/NEWS b/NEWS
index 96c7c8d..fb891fa 100644
--- a/NEWS
+++ b/NEWS
@@ -43,4 +43,6 @@ Post-v2.8.0
 - ovs-ofctl dump-ports command now prints new of set custom statistics
   if available (for OpenFlow 1.4+).
+ * New appctl command 'dpif-netdev/pmd-rxq-rebalance' to rebalance rxq to
+   pmd assignments.
  * Add rxq utilization of pmd to appctl 'dpif-netdev/pmd-rxq-show'.
- Userspace datapath:
-- 
1.8.3.1

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


[ovs-dev] [PATCH v4 1/2] dpif-netdev: Add percentage of pmd/core used by each rxq.

2018-01-16 Thread Kevin Traynor
It is based on the length of history that is stored about an
rxq (currently 1 min).

$ ovs-appctl dpif-netdev/pmd-rxq-show
pmd thread numa_id 0 core_id 4:
isolated : false
port: dpdkphy1 queue-id:  0pmd usage: 70 %
port: dpdkvhost0   queue-id:  0pmd usage:  0 %
pmd thread numa_id 0 core_id 6:
isolated : false
port: dpdkphy0 queue-id:  0pmd usage: 64 %
port: dpdkvhost1   queue-id:  0pmd usage:  0 %

These values are what would be used as part of rxq to pmd
assignment due to a reconfiguration event e.g. adding pmds,
adding rxqs or with the command:

ovs-appctl dpif-netdev/pmd-rxq-rebalance

Signed-off-by: Jan Scheurich 
Co-authored-by: Jan Scheurich 
Signed-off-by: Kevin Traynor 
---

V4:
- Left aligned port names and updated unit tests to match.

V3:
- Rebased to DPDK_MERGE branch.

V2:
- Re-worked to calculate and store cycles needed for stats directly in pmd.


 Documentation/howto/dpdk.rst | 11 +
 NEWS |  1 +
 lib/dpif-netdev.c| 53 +---
 tests/pmd.at | 51 +++---
 4 files changed, 90 insertions(+), 26 deletions(-)

diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst
index 587aaed..40f9d96 100644
--- a/Documentation/howto/dpdk.rst
+++ b/Documentation/howto/dpdk.rst
@@ -140,4 +140,15 @@ Core 7: Q4 (70%) | Q5 (10%)
 core 8: Q3 (60%) | Q0 (30%)
 
+To see the current measured usage history of pmd core cycles for each rxq::
+
+$ ovs-appctl dpif-netdev/pmd-rxq-show
+
+.. note::
+
+  A history of one minute is recorded and shown for each rxq to allow for
+  traffic pattern spikes. An rxq's pmd core cycles usage changes due to traffic
+  pattern or reconfig changes will take one minute before they are fully
+  reflected in the stats.
+
 Rxq to pmds assignment takes place whenever there are configuration changes
 or can be triggered by using::
diff --git a/NEWS b/NEWS
index 2c28456..96c7c8d 100644
--- a/NEWS
+++ b/NEWS
@@ -43,4 +43,5 @@ Post-v2.8.0
 - ovs-ofctl dump-ports command now prints new of set custom statistics
   if available (for OpenFlow 1.4+).
+ * Add rxq utilization of pmd to appctl 'dpif-netdev/pmd-rxq-show'.
- Userspace datapath:
  * Output packet batching support.
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 48a8ebb..f94b189 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -568,4 +568,9 @@ struct dp_netdev_pmd_thread {
 long long int rxq_next_cycle_store;
 
+/* Last interval timestamp. */
+uint64_t intrvl_tsc_prev;
+/* Last interval cycles. */
+atomic_ullong intrvl_cycles;
+
 /* Current context of the PMD thread. */
 struct dp_netdev_pmd_thread_ctx ctx;
@@ -933,7 +938,7 @@ pmd_info_show_rxq(struct ds *reply, struct 
dp_netdev_pmd_thread *pmd)
 {
 if (pmd->core_id != NON_PMD_CORE_ID) {
-const char *prev_name = NULL;
 struct rxq_poll *list;
-size_t i, n;
+size_t n_rxq;
+uint64_t total_cycles = 0;
 
 ds_put_format(reply,
@@ -943,20 +948,32 @@ pmd_info_show_rxq(struct ds *reply, struct 
dp_netdev_pmd_thread *pmd)
 
 ovs_mutex_lock(>port_mutex);
-sorted_poll_list(pmd, , );
-for (i = 0; i < n; i++) {
-const char *name = netdev_rxq_get_name(list[i].rxq->rx);
+sorted_poll_list(pmd, , _rxq);
 
-if (!prev_name || strcmp(name, prev_name)) {
-if (prev_name) {
-ds_put_cstr(reply, "\n");
-}
-ds_put_format(reply, "\tport: %s\tqueue-id:", name);
+/* Get the total pmd cycles for an interval. */
+atomic_read_relaxed(>intrvl_cycles, _cycles);
+/* Estimate the cycles to cover all intervals. */
+total_cycles *= PMD_RXQ_INTERVAL_MAX;
+
+for (int i = 0; i < n_rxq; i++) {
+struct dp_netdev_rxq *rxq = list[i].rxq;
+const char *name = netdev_rxq_get_name(rxq->rx);
+uint64_t proc_cycles = 0;
+
+for (int j = 0; j < PMD_RXQ_INTERVAL_MAX; j++) {
+proc_cycles += dp_netdev_rxq_get_intrvl_cycles(rxq, j);
 }
-ds_put_format(reply, " %d",
+ds_put_format(reply, "\tport: %-16s\tqueue-id: %2d", name,
   netdev_rxq_get_queue_id(list[i].rxq->rx));
-prev_name = name;
+ds_put_format(reply, "\tpmd usage: ");
+if (total_cycles) {
+ds_put_format(reply, "%2"PRIu64"",
+  proc_cycles * 100 / total_cycles);
+ds_put_cstr(reply, " %");
+} else {
+ds_put_format(reply, "%s", "NOT AVAIL");
+}
+ds_put_cstr(reply, "\n");
 }
 ovs_mutex_unlock(>port_mutex);
-

Re: [ovs-dev] Hardware acceleration in OVS-DPDK

2018-01-16 Thread Chandran, Sugesh
Hi All,
MOM is uploaded in the google doc as below.

  
https://docs.google.com/document/d/1KeQB5NIUph721uuk1f1wMy4QXwSWxlzDaumd_bWX6YI/edit?usp=sharing


Regards
_Sugesh


  -Original Appointment-
  From: Chandran, Sugesh
  Sent: Friday, January 12, 2018 9:43 AM
  To: Chandran, Sugesh; d...@openvswitch.org; Darrell Ball; Simon Horman; 
Stokes, Ian; Yuanhan Liu; 'Finn Christensen'; 'jiaquan song'; Doherty, Declan; 
Bodireddy, Bhanuprakash; Keane, Lorna; Giller, Robin
  Cc: 'pieter.jansenvanvuu...@netronome.com'; 
frikkie.scho...@netronome.com; Loftus, Ciara; Awal, Mohammad Abdul
  Subject: Hardware acceleration in OVS-DPDK
  When: Monday, January 15, 2018 5:00 PM-6:00 PM (UTC+00:00) Dublin, 
Edinburgh, Lisbon, London.
  Where: Skype Meeting


  Hi All,
  As discussed in the OVS-DPDK sync call, I am setting up a meeting to 
discuss further on hardware acceleration feature in OVS-DPDK.

  I have following points in my mind for the Agenda, Feel free to add if 
you have anything else/I missed out any.

1)  Possible partial acceleration models in OVS-DPDK, how it can co-exist 
with current implementation. In other words , how can we extend the current 
implementation in future to support them.
2)  Full offload in OVS-DPDK, How it can co-exist with current partial 
offload implementation.
3)  DPDK Requirements for supporting hardware acceleration in OVS-DPDK. 
Such as port representor models, different hardware virtual port backend 
implementations, data path handling and etc.
4)  Device + Port model and Device Capability query support for different 
hardware devices. How to use them in OVS-DPDK for hardware acceleration 
implementation.


  The meeting is going to be over skype. Hopefully everyone can access it.


  MOM is uploaded in the google doc as below.


  
https://docs.google.com/document/d/1KeQB5NIUph721uuk1f1wMy4QXwSWxlzDaumd_bWX6YI/edit?usp=sharing




  
.
  --> Join Skype Meeting
Trouble Joining? Try Skype Web 
App
  Join by phone
  +1(916)356-2663 (or your local bridge access #) Choose bridge 
5.
 (Global) English (United States)
  Find a local number

  Conference ID: 568120563
   Forgot your dial-in PIN? 
|Help

  [!OC([1033])!]
  
.


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


Re: [ovs-dev] Odd gre_sys MTU setting (2.6.x vs 2.8.x)

2018-01-16 Thread James Page
On Tue, 16 Jan 2018 at 16:26 James Page  wrote:

> On Tue, 16 Jan 2018 at 16:23 James Page  wrote:
>
>>
>> On Tue, 16 Jan 2018 at 15:47 Eric Garver  wrote:
>> [...]
>>
>>> > Re-tested with the mainline kernel; gre_sys device is still configured
>>> with
>>> > a 1472 MTU, however I was then able to increase it using ip link set
>>> > gre_sys mtu , confirming that the kernel applied hardware limit
>>> was not
>>> > longer being enforced - however looks like the IFLA_MTU settings
>>> provided
>>> > from OVS are still being ignored by the kernel.
>>>
>>> What was the value of ? Did you try 66535 (what OVS uses)? Any dmesg
>>> for the OVS case?
>>>
>>
>> Good question:
>>
>> # ip link set gre_sys mtu 65535
>> RTNETLINK answers: Invalid argument
>> # ip link set gre_sys mtu 9000
>> # ip link
>> [...]
>> 18: gre_sys@NONE:  mtu 9000 qdisc
>> pfifo_fast master ovs-system state UNKNOWN mode DEFAULT group default qlen
>> 1000
>> link/ether ea:38:bd:61:29:4d brd ff:ff:ff:ff:ff:ff
>>
>> so the value set by OVS was not accepted using ip as well.
>>
>
> 65490 was the largest MTU value I am able to set via the ip command
>

And to confirm no error messages in dmesg.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] Odd gre_sys MTU setting (2.6.x vs 2.8.x)

2018-01-16 Thread James Page
On Tue, 16 Jan 2018 at 16:23 James Page  wrote:

>
> On Tue, 16 Jan 2018 at 15:47 Eric Garver  wrote:
> [...]
>
>> > Re-tested with the mainline kernel; gre_sys device is still configured
>> with
>> > a 1472 MTU, however I was then able to increase it using ip link set
>> > gre_sys mtu , confirming that the kernel applied hardware limit was
>> not
>> > longer being enforced - however looks like the IFLA_MTU settings
>> provided
>> > from OVS are still being ignored by the kernel.
>>
>> What was the value of ? Did you try 66535 (what OVS uses)? Any dmesg
>> for the OVS case?
>>
>
> Good question:
>
> # ip link set gre_sys mtu 65535
> RTNETLINK answers: Invalid argument
> # ip link set gre_sys mtu 9000
> # ip link
> [...]
> 18: gre_sys@NONE:  mtu 9000 qdisc
> pfifo_fast master ovs-system state UNKNOWN mode DEFAULT group default qlen
> 1000
> link/ether ea:38:bd:61:29:4d brd ff:ff:ff:ff:ff:ff
>
> so the value set by OVS was not accepted using ip as well.
>

65490 was the largest MTU value I am able to set via the ip command.

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


Re: [ovs-dev] Odd gre_sys MTU setting (2.6.x vs 2.8.x)

2018-01-16 Thread James Page
On Tue, 16 Jan 2018 at 15:47 Eric Garver  wrote:
[...]

> > Re-tested with the mainline kernel; gre_sys device is still configured
> with
> > a 1472 MTU, however I was then able to increase it using ip link set
> > gre_sys mtu , confirming that the kernel applied hardware limit was
> not
> > longer being enforced - however looks like the IFLA_MTU settings provided
> > from OVS are still being ignored by the kernel.
>
> What was the value of ? Did you try 66535 (what OVS uses)? Any dmesg
> for the OVS case?
>

Good question:

# ip link set gre_sys mtu 65535
RTNETLINK answers: Invalid argument
# ip link set gre_sys mtu 9000
# ip link
[...]
18: gre_sys@NONE:  mtu 9000 qdisc
pfifo_fast master ovs-system state UNKNOWN mode DEFAULT group default qlen
1000
link/ether ea:38:bd:61:29:4d brd ff:ff:ff:ff:ff:ff

so the value set by OVS was not accepted using ip as well.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2] odp-util: fix a compiler warning

2018-01-16 Thread Aaron Conole
The result of a ternary operation will be promoted at least to int
type.  As such, the compiler may generate a warning as:
  format specifies type 'unsigned char' but the argument has type 'int'

Squelch this by preferring the %d format specifier to print 1/0 values.

Fixes: 74c4530dca93 ("ofproto-dpif: Don't slow-path controller actions with 
pause.")
Cc: Justin Pettit 
Signed-off-by: Aaron Conole 
---
v1->v2: instead of using a cast, use a different format string.

 lib/odp-util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/odp-util.c b/lib/odp-util.c
index af995efca..8a5e9e82e 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -481,8 +481,8 @@ format_odp_userspace_action(struct ds *ds, const struct 
nlattr *attr,
 ds_put_char(ds, ')');
 } else if (cookie.type == USER_ACTION_COOKIE_CONTROLLER) {
 ds_put_format(ds, ",controller(reason=%"PRIu16
-  ",dont_send=%"PRIu8
-  ",continuation=%"PRIu8
+  ",dont_send=%d"
+  ",continuation=%d"
   ",recirc_id=%"PRIu32
   ",rule_cookie=%#"PRIx64
   ",controller_id=%"PRIu16
-- 
2.14.3

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


Re: [ovs-dev] Odd gre_sys MTU setting (2.6.x vs 2.8.x)

2018-01-16 Thread Eric Garver
On Tue, Jan 16, 2018 at 06:27:23AM +, James Page wrote:
> On Mon, 15 Jan 2018 at 18:55 Christian Ehrhardt <
> christian.ehrha...@canonical.com> wrote:
> 
> > On Mon, Jan 15, 2018 at 5:43 PM, Eric Garver  wrote:
> > > On Mon, Jan 15, 2018 at 11:32:32AM -0500, Eric Garver wrote:
> > >> On Mon, Jan 15, 2018 at 03:17:28PM +, James Page wrote:
> > >> > Hi Eric
> > >> >
> > >> > On Mon, 15 Jan 2018 at 16:54 Eric Garver  wrote:
> > >> >
> > >> > > On Sat, Jan 13, 2018 at 03:57:08PM +, James Page wrote:
> > >> > > > Hi Ben s
> > >> > > >
> > >> > > > On Sat, 13 Jan 2018 at 14:55 James Page 
> > wrote:
> > >> > > >
> > >> > > > > OK, I sent a patch:
> > >> > > > >> https://patchwork.ozlabs.org/patch/860192/
> > >> > > > >
> > >> > > > >
> > >> > > > > Thanks Ben - I'll pull this patch into the Ubuntu packages and
> > test
> > >> > > this
> > >> > > > > weekend.
> > >> > > > >
> > >> > > >
> > >> > > >  I pulled your patch in ontop of our current 2.8.1 packages and
> > >> > > re-tested;
> > >> > > > I'm not seeing a difference in behaviour with the patch in place.
> > I
> > >> > > removed
> > >> > > > the vport_gre and ip_gre kernel modules to force a re-creation of
> > the
> > >> > > > device on restart of OVS as well as trying a reboot of the test
> > machine:
> > >> > > >
> > >> > > > 7: gre0@NONE:  mtu 1476 qdisc noop state DOWN mode
> > DEFAULT group
> > >> > > > default qlen 1
> > >> > > > link/gre 0.0.0.0 brd 0.0.0.0
> > >> > > > 8: gretap0@NONE:  mtu 1462 qdisc noop state
> > DOWN
> > >> > > mode
> > >> > > > DEFAULT group default qlen 1000
> > >> > > > link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
> > >> > > > 9: gre_sys@NONE:  mtu 1472 qdisc
> > >> > > > pfifo_fast master ovs-system state UNKNOWN mode DEFAULT group
> > default
> > >> > > qlen
> > >> > > > 1000
> > >> > > > link/ether 52:ad:6d:89:bb:54 brd ff:ff:ff:ff:ff:ff
> > >> > >
> > >> > > Are there any errors is dmesg? It's possible setlink won't accept
> > >> > > UINT16_MAX. grep for "Invalid MTU".
> > >> > >
> > >> >
> > >> > Not under 4.4 but I do under 4.13:
> > >> >
> > >> > [6.794079] gre: GRE over IPv4 demultiplexor driver
> > >> > [6.797621] ip_gre: GRE over IPv4 tunneling driver
> > >> > [6.798326] gre_sys: Invalid MTU 65535 requested, hw max 1500
> > >> >
> > >> > Looks like the kernel is limiting to 1500.
> > >>
> > >> I would expect setting with ip-link to fail as well.
> > >> What does the below show?:
> > >>
> > >>   $ ip link set dev gre_sys mtu 65535
> > >
> > > Ugh. This is a separate kernel bug fixed by this commit:
> > >
> > > commit cfddd4c33c254954927942599d299b3865743146 <(386)%20574-3146>
> > > Author: Xin Long 
> > > Date:   Mon Dec 18 14:24:35 2017 +0800
> > >
> > > ip_gre: remove the incorrect mtu limit for ipgre tap
> >
> > Thanks Eric, that matches my findings, glad that there seems to be an
> > accepted fix already.
> > But it is fairly recent and only in since 4.15-rc8 levels afaik.
> >
> > But OTOH its description at [1] reads pretty much like my notes so far.
> >
> > @James - do you think you could test a super-recent mainline kernel
> > build from [2] in regard to this issue?
> >
> 
> Thanks all
> 
> Re-tested with the mainline kernel; gre_sys device is still configured with
> a 1472 MTU, however I was then able to increase it using ip link set
> gre_sys mtu , confirming that the kernel applied hardware limit was not
> longer being enforced - however looks like the IFLA_MTU settings provided
> from OVS are still being ignored by the kernel.

What was the value of ? Did you try 66535 (what OVS uses)? Any dmesg
for the OVS case?
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 0/3] Initial support for new SIP Alg.

2018-01-16 Thread Tiago Lam

Hi Mark,

Thanks for the review (and pointers), I very much appreciate it.

I've only skimmed through it so far, but I'll take it into account when 
sending v2. As I mentioned before I want to put some testing in place 
first and haven't had time to get that into place yet, hopefully this 
coming week.


Regards,

Tiago

On 01/15/2018 04:03 PM, Mark Michelson wrote:

Hi Tiago,

I've given patches 1 and 2 a review. I did not have any comments to add
for patch 3. I did not add any comments for items that you already had
XXX lines for, since you already understand what is missing.

Looking forward to the next patchset!
Mark

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


Re: [ovs-dev] [PATCH v3 1/2] dpif-netdev: Add percentage of pmd/core used by each rxq.

2018-01-16 Thread Ilya Maximets
Not a full review. Few comments inline.

Best regards, Ilya Maximets.

On 15.01.2018 20:58, Kevin Traynor wrote:
> It is based on the length of history that is stored about an
> rxq (currently 1 min).
> 
> $ ovs-appctl dpif-netdev/pmd-rxq-show
> pmd thread numa_id 0 core_id 4:
> isolated : false
> port: dpdkphy1  queue-id:  0pmd usage: 70 %
> port:   dpdkvhost0  queue-id:  0pmd usage:  0 %
> pmd thread numa_id 0 core_id 6:
> isolated : false
> port: dpdkphy0  queue-id:  0pmd usage: 64 %
> port:   dpdkvhost1  queue-id:  0pmd usage:  0 %
> 
> These values are what would be used as part of rxq to pmd
> assignment due to a reconfiguration event e.g. adding pmds,
> adding rxqs or with the command:
> 
> ovs-appctl dpif-netdev/pmd-rxq-rebalance
> 
> Signed-off-by: Jan Scheurich 
> Co-authored-by: Jan Scheurich 
> Signed-off-by: Kevin Traynor 
> ---
> 
> V3:
> - Rebased to DPDK_MERGE branch.
> 
> V2:
> - Re-worked to calculate and store cycles needed for stats directly in pmd.
> 
>  Documentation/howto/dpdk.rst | 11 +
>  NEWS |  1 +
>  lib/dpif-netdev.c| 53 
> +---
>  tests/pmd.at | 51 +++---
>  4 files changed, 90 insertions(+), 26 deletions(-)
> 
> diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst
> index 587aaed..40f9d96 100644
> --- a/Documentation/howto/dpdk.rst
> +++ b/Documentation/howto/dpdk.rst
> @@ -140,4 +140,15 @@ Core 7: Q4 (70%) | Q5 (10%)
>  core 8: Q3 (60%) | Q0 (30%)
>  
> +To see the current measured usage history of pmd core cycles for each rxq::
> +
> +$ ovs-appctl dpif-netdev/pmd-rxq-show
> +
> +.. note::
> +
> +  A history of one minute is recorded and shown for each rxq to allow for
> +  traffic pattern spikes. An rxq's pmd core cycles usage changes due to 
> traffic
> +  pattern or reconfig changes will take one minute before they are fully
> +  reflected in the stats.
> +
>  Rxq to pmds assignment takes place whenever there are configuration changes
>  or can be triggered by using::
> diff --git a/NEWS b/NEWS
> index 2c28456..96c7c8d 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -43,4 +43,5 @@ Post-v2.8.0
>  - ovs-ofctl dump-ports command now prints new of set custom 
> statistics
>if available (for OpenFlow 1.4+).
> + * Add rxq utilization of pmd to appctl 'dpif-netdev/pmd-rxq-show'.
> - Userspace datapath:
>   * Output packet batching support.
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 48a8ebb..28a418f 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -568,4 +568,9 @@ struct dp_netdev_pmd_thread {
>  long long int rxq_next_cycle_store;
>  
> +/* Last interval timestamp. */
> +uint64_t intrvl_tsc_prev;
> +/* Last interval cycles. */
> +atomic_ullong intrvl_cycles;
> +
>  /* Current context of the PMD thread. */
>  struct dp_netdev_pmd_thread_ctx ctx;
> @@ -933,7 +938,7 @@ pmd_info_show_rxq(struct ds *reply, struct 
> dp_netdev_pmd_thread *pmd)
>  {
>  if (pmd->core_id != NON_PMD_CORE_ID) {
> -const char *prev_name = NULL;
>  struct rxq_poll *list;
> -size_t i, n;
> +size_t n_rxq;
> +uint64_t total_cycles = 0;
>  
>  ds_put_format(reply,
> @@ -943,20 +948,32 @@ pmd_info_show_rxq(struct ds *reply, struct 
> dp_netdev_pmd_thread *pmd)
>  
>  ovs_mutex_lock(>port_mutex);
> -sorted_poll_list(pmd, , );
> -for (i = 0; i < n; i++) {
> -const char *name = netdev_rxq_get_name(list[i].rxq->rx);
> +sorted_poll_list(pmd, , _rxq);
>  
> -if (!prev_name || strcmp(name, prev_name)) {
> -if (prev_name) {
> -ds_put_cstr(reply, "\n");
> -}
> -ds_put_format(reply, "\tport: %s\tqueue-id:", name);
> +/* Get the total pmd cycles for an interval. */
> +atomic_read_relaxed(>intrvl_cycles, _cycles);
> +/* Estimate the cycles to cover all intervals. */
> +total_cycles *= PMD_RXQ_INTERVAL_MAX;
> +
> +for (int i = 0; i < n_rxq; i++) {
> +struct dp_netdev_rxq *rxq = list[i].rxq;
> +const char *name = netdev_rxq_get_name(rxq->rx);
> +uint64_t proc_cycles = 0;
> +
> +for (int j = 0; j < PMD_RXQ_INTERVAL_MAX; j++) {
> +proc_cycles += dp_netdev_rxq_get_intrvl_cycles(rxq, j);
>  }
> -ds_put_format(reply, " %d",
> +ds_put_format(reply, "\tport: %16s\tqueue-id: %2d", name,
>netdev_rxq_get_queue_id(list[i].rxq->rx));

Can we use left-justified output for the port name (i.e. "%-16s").
Looks more natural, especially if port names has different lengths.

> -prev_name = name;

Re: [ovs-dev] [PATCH v2] netdev-dpdk: add vhost-user get_status.

2018-01-16 Thread Kevin Traynor
On 01/16/2018 04:22 AM, Flavio Leitner wrote:
> Expose relevant vhost-user information in status.
> 
> Signed-off-by: Flavio Leitner 

LGTM

Tested-by: Kevin Traynor 
Acked-by: Kevin Traynor 

> ---
>  NEWS  |  1 +
>  lib/netdev-dpdk.c | 62 
> +--
>  2 files changed, 61 insertions(+), 2 deletions(-)
> 
> Changelog:
> V2 - Dropped the custom appctl command in favor of get_status.
> 
> diff --git a/NEWS b/NEWS
> index cb020d00d..2bf0bde82 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -47,6 +47,7 @@ Post-v2.8.0
>   * Configuring a controller, or unconfiguring all controllers, now 
> deletes
> all groups and meters (as well as all flows).
> - New --enable-sparse configure option enables "sparse" checking by 
> default.
> +   - Added additional information to vhost-user status.
>  
>  v2.8.0 - 31 Aug 2017
>  
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index e32c7f678..cbf4a9c0a 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -2614,6 +2614,64 @@ netdev_dpdk_update_flags(struct netdev *netdev,
>  return error;
>  }
>  
> +static int
> +netdev_dpdk_vhost_user_get_status(const struct netdev *netdev,
> +  struct smap *args)
> +{
> +struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
> +
> +ovs_mutex_lock(>mutex);
> +
> +bool client_mode = dev->vhost_driver_flags & RTE_VHOST_USER_CLIENT;
> +smap_add_format(args, "mode", "%s", client_mode ? "client" : "server");
> +
> +int vid = netdev_dpdk_get_vid(dev);
> +if (vid < 0) {
> +smap_add_format(args, "status", "disconnected");
> +ovs_mutex_unlock(>mutex);
> +return 0;
> +} else {
> +smap_add_format(args, "status", "connected");
> +}
> +
> +char socket_name[PATH_MAX];
> +if (!rte_vhost_get_ifname(vid, socket_name, PATH_MAX)) {
> +smap_add_format(args, "socket", "%s", socket_name);
> +}
> +
> +uint64_t features;
> +if (!rte_vhost_get_negotiated_features(vid, )) {
> +smap_add_format(args, "features", "0x%016"PRIx64, features);
> +}
> +
> +uint16_t mtu;
> +if (!rte_vhost_get_mtu(vid, )) {
> +smap_add_format(args, "mtu", "%d", mtu);
> +}
> +
> +int numa = rte_vhost_get_numa_node(vid);
> +if (numa >= 0) {
> +smap_add_format(args, "numa", "%d", numa);
> +}
> +
> +uint16_t vring_num = rte_vhost_get_vring_num(vid);
> +if (vring_num) {
> +smap_add_format(args, "num_of_vrings", "%d", vring_num);
> +}
> +
> +for (int i = 0; i < vring_num; i++) {
> +struct rte_vhost_vring vring;
> +char vhost_vring[16];
> +
> +rte_vhost_get_vhost_vring(vid, i, );
> +snprintf(vhost_vring, 16, "vring_%d_size", i);
> +smap_add_format(args, vhost_vring, "%d", vring.size);
> +}
> +
> +ovs_mutex_unlock(>mutex);
> +return 0;
> +}
> +
>  static int
>  netdev_dpdk_get_status(const struct netdev *netdev, struct smap *args)
>  {
> @@ -3698,7 +3756,7 @@ static const struct netdev_class dpdk_vhost_class =
>  netdev_dpdk_vhost_get_stats,
>  NULL,
>  NULL,
> -NULL,
> +netdev_dpdk_vhost_user_get_status,
>  netdev_dpdk_vhost_reconfigure,
>  netdev_dpdk_vhost_rxq_recv);
>  static const struct netdev_class dpdk_vhost_client_class =
> @@ -3714,7 +3772,7 @@ static const struct netdev_class 
> dpdk_vhost_client_class =
>  netdev_dpdk_vhost_get_stats,
>  NULL,
>  NULL,
> -NULL,
> +netdev_dpdk_vhost_user_get_status,
>  netdev_dpdk_vhost_client_reconfigure,
>  netdev_dpdk_vhost_rxq_recv);
>  
> 

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


Re: [ovs-dev] [PATCH v6 0/8] Add OVS DPDK keep-alive functionality.

2018-01-16 Thread Bodireddy, Bhanuprakash
>Hi,
>
>Sorry to jump on this at v6 only, but I skimmed over the code and I am
>struggling to understand what problem you're trying to solve. Yes, I realize
>you want some sort of feedback about the PMD processing, but it's not clear
>to me what exactly you want from it.
>
>This last patchset uses a separate thread just to monitor the PMD threads
>which can update their status in the core busy loop.  I guess it tells you if 
>the
>PMD thread is stuck or not, but not really if it's processing packets.  That's
>again, my question above.
>
>If you need to know if the thread is running, I think any OVS can provide you
>the process stats which should be more reliable and doesn't depend on OVS
>at all.
>
>I appreciate if you could elaborate more on the use-case.

Intel SA team has been working on  SA Framework for NFV environment and has 
defined interfaces
for the base platform(aligned with ETSI GS NFV 002)  which includes compute, 
storage, NW, virtual switch, OS and hypervisor.
The core idea here is to monitor and detect the service impacting faults on the 
Base platform. 
Both reactive and pro-active fault detection techniques are employed and faults 
are reported to
higher level layers for corrective actions. The corrective actions for example 
here can be migrating
the workloads, marking the compute offline and is based on the policies 
enforced at higher layers.

One aspect of larger SA framework is monitoring virtual switch health. Some of 
the events of interest here
are link status, OvS DB connection status, packet statistics(drops/errors), PMD 
health. 

This patch series has only implemented *PMD health* monitoring and reporting 
mechanism and the details are
already in the patch. The other interesting events of virtual switch are 
already implemented as part of collectd plugin.

On your questions:

> I guess it tells you if the PMD thread is stuck or not, but not really if 
> it's processing packets.  That's
>again, my question above.

The functionality to check if the PMD is processing the packets was implemented 
way back in v3.
https://mail.openvswitch.org/pipermail/ovs-dev/2017-August/336789.html

For easier review, the patch series was split up in v4 to get the basic 
functionality in. This is mentioned in version change log below.
https://mail.openvswitch.org/pipermail/ovs-dev/2017-August/337702.html

>If you need to know if the thread is running, I think any OVS can provide you
>the process stats which should be more reliable and doesn't depend on OVS
>at all.

There is a problem here and I did simulate the case to show that the stats 
reported by OS aren't accurate in the below thread.
https://mail.openvswitch.org/pipermail/ovs-dev/2017-September/338388.html

Check the details on /proc/[pid]/stats. Though the PMD thread is stalled, OS 
reports the thread as *Running (R)* state.

- Bhanuprakash.

>
>
>On Fri, Dec 08, 2017 at 12:04:19PM +, Bhanuprakash Bodireddy wrote:
>> Keepalive feature is aimed at achieving Fastpath Service Assurance in
>> OVS-DPDK deployments. It adds support for monitoring the packet
>> processing threads by dispatching heartbeats at regular intervals.
>>
>> keepalive feature can be enabled through below OVSDB settings.
>>
>> enable-keepalive=true
>>   - Keepalive feature is disabled by default and should be enabled
>> at startup before ovs-vswitchd daemon is started.
>>
>> keepalive-interval="5000"
>>   - Timer interval in milliseconds for monitoring the packet
>> processing cores.
>>
>> TESTING:
>> The testing of keepalive is done using stress cmd (simulating the 
>> stalls).
>>   - pmd-cpu-mask=0xf [MQ enabled on DPDK ports]
>>   - stress -c 1 &  [tid is usually the __tid + 1 of the output]
>>   - chrt -r -p 99 [set realtime priority for stress thread]
>>   - taskset -p 0x8[Pin the stress thread to the core PMD is 
>> running]
>>   - PMD thread will be descheduled due to its normal priority and yields
>> core to stress thread.
>>
>>   - ovs-appctl keepalive/pmd-health-show   [Display that the thread is
>GONE]
>>   - ./ovsdb/ovsdb-client monitor Open_vSwitch  [Should update the
>> status]
>>
>>   - taskset -p 0x10   [This brings back pmd thread to life as stress
>thread
>> is moved to idle core]
>>
>>   (watch out for stress threads, and carefully pin them to core not to 
>> hang
>your DUTs
>>during tesing).
>>
>> v5 -> v6
>>   * Remove 2 patches from series
>>  - xnanosleep was applied to master as part of high resolution timeout
>support.
>>  - Extend get_process_info() API was also applied to master earlier.
>>   * Remove KA_STATE_DOZING as it was initially meant to handle Core C
>states, not needed
>> for now.
>>   * Fixed ka_destroy(), to fix unit test cases 536, 537.
>>   * A minor performance degradation(0.5%) is observed with Keepalive
>enabled.
>> [Tested with loopback case using 1000 IXIA streams/64 byte 

[ovs-dev] [PATCH OVS 1/1] dpif: geneve: supply dpif function to get ifindex

2018-01-16 Thread John Hurley
Geneve tunnels are not given a netdev_class function to determine their
ifindex. This means when ofproto-dpif attempts to add a geneve netdev
it fails in 'netdev_ports_insert' in netdev.c. Failure to add this means
that further operations like offloading a rule that egresses to a geneve
port will be rejected as the egress port cannot be found. This patch
applies the same ifindex function to geneve as is used in vxlan.

Signed-off-by: John Hurley 
Acked-by: Simon Horman 
---
 lib/netdev-vport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
index d11c5cc..89c8bde 100644
--- a/lib/netdev-vport.c
+++ b/lib/netdev-vport.c
@@ -966,7 +966,7 @@ netdev_vport_tunnel_register(void)
 TUNNEL_CLASS("geneve", "genev_sys", netdev_geneve_build_header,
 netdev_tnl_push_udp_header,
 netdev_geneve_pop_header,
-NULL),
+NETDEV_VPORT_GET_IFINDEX),
 TUNNEL_CLASS("gre", "gre_sys", netdev_gre_build_header,
netdev_gre_push_header,
netdev_gre_pop_header,
-- 
1.9.1

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


Re: [ovs-dev] [PATCH v8] netdev-dpdk: Add support for vHost dequeue zero copy (experimental)

2018-01-16 Thread Stokes, Ian
> -Original Message-
> From: Loftus, Ciara
> Sent: Friday, January 5, 2018 4:14 PM
> To: d...@openvswitch.org
> Cc: Loftus, Ciara ; Stokes, Ian
> ; jan.scheur...@ericsson.com; ktray...@redhat.com;
> i.maxim...@samsung.com
> Subject: [PATCH v8] netdev-dpdk: Add support for vHost dequeue zero copy
> (experimental)
> 

Hi Ciara,

This seems to have been simplified from the previous patchsets, I'll need to do 
some testing but some comments inline below that could be addressed for a v9.

Thanks
Ian

> Zero copy is disabled by default. To enable it, set the 'dq-zero-copy'
> option to 'true' when configuring the Interface:
> 
> ovs-vsctl set Interface dpdkvhostuserclient0
> options:vhost-server-path=/tmp/dpdkvhostuserclient0
> options:dq-zero-copy=true
> 
> When packets from a vHost device with zero copy enabled are destined for a
> single 'dpdk' port, the number of tx descriptors on that 'dpdk' port must
> be set to a smaller value. 128 is recommended. This can be achieved like
> so:
> 
> ovs-vsctl set Interface dpdkport options:n_txq_desc=128
> 
> Note: The sum of the tx descriptors of all 'dpdk' ports the VM will send
> to should not exceed 128. Due to this requirement, the feature is
> considered 'experimental'.
> 
> Testing of the patch showed a 15% improvement when switching 512B packets
> between vHost devices on different VMs on the same host when zero copy was
> enabled on the transmitting device.
> 
> Signed-off-by: Ciara Loftus 
> ---
> v8:
> * Disallow configurability after vHost device has been registered & update
> docs accordingly.
> * Give performance datapoint in commit message.
> 
>  Documentation/intro/install/dpdk.rst |  2 +
>  Documentation/topics/dpdk/vhost-user.rst | 72
> 
>  NEWS |  1 +
>  lib/netdev-dpdk.c|  9 +++-
>  vswitchd/vswitch.xml | 11 +
>  5 files changed, 94 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/intro/install/dpdk.rst
> b/Documentation/intro/install/dpdk.rst
> index 3fecb5c..087eb88 100644
> --- a/Documentation/intro/install/dpdk.rst
> +++ b/Documentation/intro/install/dpdk.rst
> @@ -518,6 +518,8 @@ The above command sets the number of rx queues for
> DPDK physical interface.
>  The rx queues are assigned to pmd threads on the same NUMA node in a
> round-robin fashion.
> 
> +.. _dpdk-queues-sizes:
> +
>  DPDK Physical Port Queue Sizes
>  ~~~
> 
> diff --git a/Documentation/topics/dpdk/vhost-user.rst
> b/Documentation/topics/dpdk/vhost-user.rst
> index 8447e2d..1a6c6d0 100644
> --- a/Documentation/topics/dpdk/vhost-user.rst
> +++ b/Documentation/topics/dpdk/vhost-user.rst
> @@ -458,3 +458,75 @@ Sample XML
>  
> 
>  .. _QEMU documentation: http://git.qemu-
> project.org/?p=qemu.git;a=blob;f=docs/specs/vhost-
> user.txt;h=7890d7169;hb=HEAD
> +
> +vhost-user Dequeue Zero Copy (experimental)
> +---
> +
> +Normally when dequeuing a packet from a vHost User device, a memcpy
> +operation must be used to copy that packet from guest address space to
> +host address space. This memcpy can be removed by enabling dequeue zero-
> copy like so::
> +
> +$ ovs-vsctl add-port br0 dpdkvhostuserclient0 -- set Interface \
> +dpdkvhostuserclient0 type=dpdkvhostuserclient \
> +options:vhost-server-path=/tmp/dpdkvhostclient0 \
> +options:dq-zero-copy=true
> +
> +With this feature enabled, a reference (pointer) to the packet is
> +passed to the host, instead of a copy of the packet. Removing this
> +memcpy can give a performance improvement for some use cases, for
> +example switching large packets between different VMs. However additional
> packet loss may be observed.
> +
> +Note that the feature is disabled by default and must be explicitly
> +enabled by setting the 'dq-zero-copy' option to 'true' while specifying
> +the 'vhost-server-path' option as above. If you wish to split out the
> +command into multiple commands as below, ensure 'dq-zero-copy' is set
> +before
> +'vhost-server-path'::
> +
> +$ ovs-vsctl set Interface dpdkvhostuserclient0 options:dq-zero-
> copy=true
> +$ ovs-vsctl set Interface dpdkvhostuserclient0 \
> +options:vhost-server-path=/tmp/dpdkvhostclient0
> +
> +The feature is only available to dpdkvhostuserclient port types.
> +
> +A limitation exists whereby if packets from a vHost port with
> +dq-zero-copy=true are destined for a 'dpdk' type port, the number of tx
> +descriptors (n_txq_desc) for that port must be reduced to a smaller
> +number, 128 being the recommended value. This can be achieved by issuing
> the following command::
> +
> +$ ovs-vsctl set Interface dpdkport options:n_txq_desc=128
> +
> +Note: The sum of the tx descriptors of all 'dpdk' ports the VM will
> +send to should not exceed 128. For example, in case of a bond over 

Re: [ovs-dev] [PATCH] bfd: Send BFD packets with DSCP CS6

2018-01-16 Thread Zoltán Balogh
Hi,

Acked-by: Zoltan Balogh 

Ben, is there a chance to get this into 2.9?

Best regards,
Zoltan

> -Original Message-
> From: ovs-dev-boun...@openvswitch.org 
> [mailto:ovs-dev-boun...@openvswitch.org] On Behalf Of Venkatesan Pradeep
> Sent: Wednesday, January 10, 2018 6:02 AM
> To: d...@openvswitch.org
> Subject: Re: [ovs-dev] [PATCH] bfd: Send BFD packets with DSCP CS6
> 
> Gentle reminder to review this patch.
> 
> Regards,
> 
> Pradeep
> 
> -Original Message-
> From: ovs-dev-boun...@openvswitch.org 
> [mailto:ovs-dev-boun...@openvswitch.org] On Behalf Of Venkatesan Pradeep
> Sent: Monday, December 25, 2017 10:29 PM
> To: d...@openvswitch.org
> Subject: [ovs-dev] [PATCH] bfd: Send BFD packets with DSCP CS6
> 
> Send BFD packets with TOS value equivalent to DSCP CS6 so that the network 
> can apply the right QoS for those
> packets. This can help avoid BFD flaps due to network congestion.
> 
> Signed-off-by: Venkatesan Pradeep 
> ---
>  lib/bfd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/bfd.c b/lib/bfd.c
> index 40cd0be..8d291bb 100644
> --- a/lib/bfd.c
> +++ b/lib/bfd.c
> @@ -612,7 +612,7 @@ bfd_put_packet(struct bfd *bfd, struct dp_packet *p,
>  ip->ip_ihl_ver = IP_IHL_VER(5, 4);
>  ip->ip_tot_len = htons(sizeof *ip + sizeof *udp + sizeof *msg);
>  ip->ip_ttl = MAXTTL;
> -ip->ip_tos = IPTOS_LOWDELAY | IPTOS_THROUGHPUT;
> +ip->ip_tos = IPTOS_PREC_INTERNETCONTROL;
>  ip->ip_proto = IPPROTO_UDP;
>  put_16aligned_be32(>ip_src, bfd->ip_src);
>  put_16aligned_be32(>ip_dst, bfd->ip_dst); 
> ___
> 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
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev