[ovs-dev] [PATCH ovn] controller: Fix toggling ct zone ids.

2021-02-12 Thread numans
From: Numan Siddique 

ovn-controller maintains a shash of pending ct zone entries
to flush the ct zone ids and to store/remove the allocated zone id
in/from the OVS bridge.external_ids.  While adding an entry to
the shash, the function 'add_pending_ct_zone_entry()' doesn't
check for existing entry for the same key in shash.  If suppose
there are multiple entries for the samestring key, then it results in
an infinite loop of adding and deleting the key entries in
OVS bridge.external_ids.

The pending ct zone entries are deleted from the shash when they
reach the state - CT_ZONE_DB_SENT and when
ovsdb_idl_loop_commit_and_wait(ovsidl) returns 1.  In a highly loaded
compute node this loop gets triggered when this function doesn't return
1 and there are duplicate ct zone entries.

These duplicate entries are mostly observed for logical ports of
type 'virtual' when this virtual port keeps moving from one chassis
to another.  But this scenario can get triggered for other logical ports
too.

*
2021-02-12T17:25:56.974Z|04363|jsonrpc|DBG|unix:/run/openvswitch/db.sock: send 
request, method="transact", 
params=["Open_vSwitch",{"mutations":[["external_ids","delete",["set",["ct-zone-313f5395-5170-4c4c-8820-e6288a765d27","ct-zone-efa8530b-93d5-45b3-b16f-edfe1856233c"]]],["external_ids","insert",["map",[["ct-zone-da4a2f90-aef9-4fea-ad6d-aed364fa9988","63"],["ct-zone-7a97e014-a753-473b-a0f3-b2ec6e9f11d6","71"],"where":[["_uuid","==",["uuid","653e7315-47b3-4c39-a5f9-665aa3dddb9e"]]],"op":"mutate","table":"Bridge"},{"comment":"ovn-controller\novn-controller:
 modifying OVS tunnels 
'e3af60d7-3942-4aa2-84ad-e02dcd3b183d'","op":"comment"}], id=4336
2021-02-12T17:25:56.979Z|04364|jsonrpc|DBG|unix:/run/openvswitch/db.sock: 
received notification, method="update3", 
params=[["monid","Open_vSwitch"],"----",{"Bridge":{"653e7315-47b3-4c39-a5f9-665aa3dddb9e":{"modify":{"external_ids":["map",[["ct-zone-313f5395-5170-4c4c-8820-e6288a765d27","71"],["ct-zone-7a97e014-a753-473b-a0f3-b2ec6e9f11d6","71"],["ct-zone-da4a2f90-aef9-4fea-ad6d-aed364fa9988","63"],["ct-zone-efa8530b-93d5-45b3-b16f-edfe1856233c","63"]]]]
2021-02-12T17:25:56.988Z|04365|jsonrpc|DBG|unix:/run/openvswitch/db.sock: 
received reply, result=[{"count":1},{}], id=4336
2021-02-12T17:25:57.006Z|04366|jsonrpc|DBG|unix:/run/openvswitch/db.sock: send 
request, method="transact", 
params=["Open_vSwitch",{"mutations":[["external_ids","delete",["set",["ct-zone-da4a2f90-aef9-4fea-ad6d-aed364fa9988","ct-zone-7a97e014-a753-473b-a0f3-b2ec6e9f11d6"]]],["external_ids","insert",["map",[["ct-zone-313f5395-5170-4c4c-8820-e6288a765d27","71"],["ct-zone-efa8530b-93d5-45b3-b16f-edfe1856233c","63"],"where":[["_uuid","==",["uuid","653e7315-47b3-4c39-a5f9-665aa3dddb9e"]]],"op":"mutate","table":"Bridge"},{"comment":"ovn-controller\novn-controller:
 modifying OVS tunnels 
'e3af60d7-3942-4aa2-84ad-e02dcd3b183d'","op":"comment"}], id=4337
2021-02-12T17:25:57.011Z|04367|jsonrpc|DBG|unix:/run/openvswitch/db.sock: 
received notification, method="update3", 
params=[["monid","Open_vSwitch"],"----",{"Bridge":{"653e7315-47b3-4c39-a5f9-665aa3dddb9e":{"modify":{"external_ids":["map",[["ct-zone-313f5395-5170-4c4c-8820-e6288a765d27","71"],["ct-zone-7a97e014-a753-473b-a0f3-b2ec6e9f11d6","71"],["ct-zone-da4a2f90-aef9-4fea-ad6d-aed364fa9988","63"],["ct-zone-efa8530b-93d5-45b3-b16f-edfe1856233c","63"]]]]
...
...
*

This patch fixes this issue by using shash_replace() when adding the
entry to the shash.

Note: I was not able to reproduce the issue with a test setup and
hence couldn't add test cases.

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1903210
Signed-off-by: Numan Siddique 
---
 controller/ovn-controller.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index 61b809593..4343650fc 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -608,7 +608,18 @@ add_pending_ct_zone_entry(struct shash *pending_ct_zones,
 pending->state = state; /* Skip flushing zone. */
 pending->zone = zone;
 pending->add = add;
-shash_add(pending_ct_zones, name, pending);
+
+/* Its important that we add only one entry for the key 'name'.
+ * Replace 'pending' with 'existing' and free up 'existing'.
+ * Otherwise, we may end up in a continuous loop of adding
+ * and deleting the zone entry in the 'external_ids' of
+ * integration bridge.
+ */
+struct ct_zone_pending_entry *existing =
+shash_replace(pending_ct_zones, name, pending);
+if (existing) {
+free(existing);
+}
 }
 
 static void
-- 
2.29.2

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


[ovs-dev] [PATCH branch-2.14 v2] dpdk: Use DPDK 19.11.6 release.

2021-02-12 Thread Hariprasad Govindharajan
Modify ci linux build script to use the latest DPDK stable release.
Modify Documentation to use the latest DPDK stable release
19.11.6. Update NEWS file to reflect the latest DPDK stable release.

Note: 19.11.6 is the latest stable release in the 19.11 series.
So both OvS 2.13 and 2.14 are updated to use 19.11.6 version
18.11.11 is the final support release for the 18.11 series,
no further support releases for 18.11 series are expected.
So, both OvS 2.11 and 2.12 are updated to use 18.11.11.

Signed-off-by: Hariprasad Govindharajan 
Acked-by: Kevin Traynor 
---
v2:
modified NEWS file based on review comments
---
 .ci/linux-build.sh   | 2 +-
 Documentation/faq/releases.rst   | 8 
 Documentation/intro/install/dpdk.rst | 8 
 Documentation/topics/dpdk/vhost-user.rst | 6 +++---
 NEWS | 3 +++
 5 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 16102ac..0f9e808 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -187,7 +187,7 @@ fi
 
 if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="19.11.2"
+DPDK_VER="19.11.6"
 fi
 install_dpdk $DPDK_VER
 if [ "$CC" = "clang" ]; then
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 9d5d2c3..cafbebc 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -193,10 +193,10 @@ Q: What DPDK version does each Open vSwitch release work 
with?
 2.8.x17.05.2
 2.9.x17.11.10
 2.10.x   17.11.10
-2.11.x   18.11.9
-2.12.x   18.11.9
-2.13.x   19.11.2
-2.14.x   19.11.2
+2.11.x   18.11.11
+2.12.x   18.11.11
+2.13.x   19.11.6
+2.14.x   19.11.6
  
 
 Q: Are all the DPDK releases that OVS versions work with maintained?
diff --git a/Documentation/intro/install/dpdk.rst 
b/Documentation/intro/install/dpdk.rst
index fe11571..c0754bc 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -42,7 +42,7 @@ Build requirements
 In addition to the requirements described in :doc:`general`, building Open
 vSwitch with DPDK will require the following:
 
-- DPDK 19.11.2
+- DPDK 19.11.6
 
 - A `DPDK supported NIC`_
 
@@ -71,9 +71,9 @@ Install DPDK
 #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
 
$ cd /usr/src/
-   $ wget https://fast.dpdk.org/rel/dpdk-19.11.2.tar.xz
-   $ tar xf dpdk-19.11.2.tar.xz
-   $ export DPDK_DIR=/usr/src/dpdk-stable-19.11.2
+   $ wget https://fast.dpdk.org/rel/dpdk-19.11.6.tar.xz
+   $ tar xf dpdk-19.11.6.tar.xz
+   $ export DPDK_DIR=/usr/src/dpdk-stable-19.11.6
$ cd $DPDK_DIR
 
 #. (Optional) Configure DPDK as a shared library
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index f53ff3f..4ccff07 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -392,9 +392,9 @@ To begin, instantiate a guest as described in 
:ref:`dpdk-vhost-user` or
 DPDK sources to VM and build DPDK::
 
 $ cd /root/dpdk/
-$ wget https://fast.dpdk.org/rel/dpdk-19.11.2.tar.xz
-$ tar xf dpdk-19.11.2.tar.xz
-$ export DPDK_DIR=/root/dpdk/dpdk-stable-19.11.2
+$ wget https://fast.dpdk.org/rel/dpdk-19.11.6.tar.xz
+$ tar xf dpdk-19.11.6.tar.xz
+$ export DPDK_DIR=/root/dpdk/dpdk-stable-19.11.6
 $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
 $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
 $ cd $DPDK_DIR
diff --git a/NEWS b/NEWS
index 35a6bc9..515de4d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 v2.14.3 - xx xxx 
 -
+   - DPDK:
+ * OVS validated with DPDK 19.11.6. It is recommended to use this version
+   until further releases.
 
 v2.14.2 - 10 Feb 2021
 -
-- 
2.7.4

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


[ovs-dev] [PATCH branch-2.13 v3] dpdk: Use DPDK 19.11.6 release.

2021-02-12 Thread Hariprasad Govindharajan
Modify ci linux build script to use the latest DPDK stable release.
Modify Documentation to use the latest DPDK stable release
19.11.6. Update NEWS file to reflect the latest DPDK stable release.

Note: 19.11.6 is the latest stable release in the 19.11 series.
So OvS 2.13 is updated to use 19.11.6 version
18.11.11 is the final support release for the 18.11 series,
no further support releases for 18.11 series are expected.
So, both OvS 2.11 and 2.12 are updated to use 18.11.11.

Signed-off-by: Hariprasad Govindharajan 
Acked-by: Kevin Traynor 
---
v3:
modified NEWS file based on review comments
v2:
modified NEWS file based on review comments
---
 .ci/linux-build.sh   | 2 +-
 Documentation/faq/releases.rst   | 6 +++---
 Documentation/intro/install/dpdk.rst | 8 
 Documentation/topics/dpdk/vhost-user.rst | 6 +++---
 NEWS | 3 +++
 5 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index ec0b40e..4a9a20b 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -182,7 +182,7 @@ fi
 
 if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="19.11.2"
+DPDK_VER="19.11.6"
 fi
 install_dpdk $DPDK_VER
 # Enable pdump support in OVS.
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 41e1315..4a0dcac 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -190,9 +190,9 @@ Q: What DPDK version does each Open vSwitch release work 
with?
 2.8.x17.05.2
 2.9.x17.11.10
 2.10.x   17.11.10
-2.11.x   18.11.9
-2.12.x   18.11.9
-2.13.x   19.11.2
+2.11.x   18.11.11
+2.12.x   18.11.11
+2.13.x   19.11.6
  
 
 Q: Are all the DPDK releases that OVS versions work with maintained?
diff --git a/Documentation/intro/install/dpdk.rst 
b/Documentation/intro/install/dpdk.rst
index 86ee19d..050e554 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -42,7 +42,7 @@ Build requirements
 In addition to the requirements described in :doc:`general`, building Open
 vSwitch with DPDK will require the following:
 
-- DPDK 19.11.2
+- DPDK 19.11.6
 
 - A `DPDK supported NIC`_
 
@@ -71,9 +71,9 @@ Install DPDK
 #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
 
$ cd /usr/src/
-   $ wget https://fast.dpdk.org/rel/dpdk-19.11.2.tar.xz
-   $ tar xf dpdk-19.11.2.tar.xz
-   $ export DPDK_DIR=/usr/src/dpdk-stable-19.11.2
+   $ wget https://fast.dpdk.org/rel/dpdk-19.11.6.tar.xz
+   $ tar xf dpdk-19.11.6.tar.xz
+   $ export DPDK_DIR=/usr/src/dpdk-stable-19.11.6
$ cd $DPDK_DIR
 
 #. (Optional) Configure DPDK as a shared library
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index 4bc5aef..d020115 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -392,9 +392,9 @@ To begin, instantiate a guest as described in 
:ref:`dpdk-vhost-user` or
 DPDK sources to VM and build DPDK::
 
 $ cd /root/dpdk/
-$ wget https://fast.dpdk.org/rel/dpdk-19.11.2.tar.xz
-$ tar xf dpdk-19.11.2.tar.xz
-$ export DPDK_DIR=/root/dpdk/dpdk-stable-19.11.2
+$ wget https://fast.dpdk.org/rel/dpdk-19.11.6.tar.xz
+$ tar xf dpdk-19.11.6.tar.xz
+$ export DPDK_DIR=/root/dpdk/dpdk-stable-19.11.6
 $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
 $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
 $ cd $DPDK_DIR
diff --git a/NEWS b/NEWS
index 2b35e9f..e683ae2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 v2.13.4 - xx xxx 
 -
+   - DPDK:
+ * OVS validated with DPDK 19.11.6. It is recommended to use this version
+   until further releases.
 
 v2.13.3 - 10 Feb 2021
 -
-- 
2.7.4

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


[ovs-dev] [PATCH branch-2.12 v3] dpdk: Use DPDK 18.11.11 release.

2021-02-12 Thread Hariprasad Govindharajan
Modify ci linux build script to use the latest DPDK stable release.
Modify Documentation to use the latest DPDK stable release
18.11.11. Update NEWS file to reflect the latest DPDK stable
release.

Note: 18.11.11 is the final support release for the 18.11 series,
no further support releases for 18.11 series are expected.
So, both OvS 2.11 and 2.12 are updated to use 18.11.11.

Signed-off-by: Hariprasad Govindharajan 
Acked-by: Kevin Traynor 
---
v3:
modified NEWS file based on review comments
v2:
modified commit message and NEWS file based on review comments
---
 .ci/linux-build.sh   | 2 +-
 Documentation/faq/releases.rst   | 4 ++--
 Documentation/intro/install/dpdk.rst | 8 
 Documentation/topics/dpdk/vhost-user.rst | 6 +++---
 NEWS | 3 +++
 5 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index e67d889..e4a944c 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -107,7 +107,7 @@ fi
 
 if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="18.11.9"
+DPDK_VER="18.11.11"
 fi
 install_dpdk $DPDK_VER
 if [ "$CC" = "clang" ]; then
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 5a51dbc..a0a403f 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -178,8 +178,8 @@ Q: What DPDK version does each Open vSwitch release work 
with?
 2.8.x17.05.2
 2.9.x17.11.10
 2.10.x   17.11.10
-2.11.x   18.11.9
-2.12.x   18.11.9
+2.11.x   18.11.11
+2.12.x   18.11.11
  
 
 Q: Are all the DPDK releases that OVS versions work with maintained?
diff --git a/Documentation/intro/install/dpdk.rst 
b/Documentation/intro/install/dpdk.rst
index f0a7bff..a441715 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -42,7 +42,7 @@ Build requirements
 In addition to the requirements described in :doc:`general`, building Open
 vSwitch with DPDK will require the following:
 
-- DPDK 18.11.9
+- DPDK 18.11.11
 
 - A `DPDK supported NIC`_
 
@@ -71,9 +71,9 @@ Install DPDK
 #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
 
$ cd /usr/src/
-   $ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz
-   $ tar xf dpdk-18.11.9.tar.xz
-   $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.9
+   $ wget http://fast.dpdk.org/rel/dpdk-18.11.11.tar.xz
+   $ tar xf dpdk-18.11.11.tar.xz
+   $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.11
$ cd $DPDK_DIR
 
 #. (Optional) Configure DPDK as a shared library
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index 2253978..0155512 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -392,9 +392,9 @@ To begin, instantiate a guest as described in 
:ref:`dpdk-vhost-user` or
 DPDK sources to VM and build DPDK::
 
 $ cd /root/dpdk/
-$ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz
-$ tar xf dpdk-18.11.9.tar.xz
-$ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.9
+$ wget http://fast.dpdk.org/rel/dpdk-18.11.11.tar.xz
+$ tar xf dpdk-18.11.11.tar.xz
+$ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.11
 $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
 $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
 $ cd $DPDK_DIR
diff --git a/NEWS b/NEWS
index e5a41cb..db6ba9e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 v2.12.4 - xx xxx 
 -
+   - DPDK:
+ * OVS validated with DPDK 18.11.11. Due to this being the final release
+   in the DPDK 18.11 series it is recommended it to be used.
 
 v2.12.3 - 10 Feb 2021
 -
-- 
2.7.4

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


[ovs-dev] [PATCH branch-2.11 v4] dpdk: Use DPDK 18.11.11 release.

2021-02-12 Thread Hariprasad Govindharajan
Modify ci linux build script to use the latest DPDK stable release.
Modify Documentation to use the latest DPDK stable release
18.11.11. Update NEWS file to reflect the latest DPDK stable
release.

Note: 18.11.11 is the final support release for the 18.11 series,
no further support releases for 18.11 series are expected.

Signed-off-by: Hariprasad Govindharajan 
Acked-by: Kevin Traynor 
---
v4:
modified NEWS file based on review comments
v3:
fixed alignment issue in the NEWS file
v2:
modified NEWS file based on review comments
---
 .ci/linux-build.sh   | 2 +-
 Documentation/faq/releases.rst   | 2 +-
 Documentation/intro/install/dpdk.rst | 8 
 Documentation/topics/dpdk/vhost-user.rst | 6 +++---
 NEWS | 3 +++
 5 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index ab0089d..61b7374 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -88,7 +88,7 @@ fi
 
 if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="18.11.9"
+DPDK_VER="18.11.11"
 fi
 install_dpdk $DPDK_VER
 if [ "$CC" = "clang" ]; then
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 302da72..d6a93b9 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -176,7 +176,7 @@ Q: What DPDK version does each Open vSwitch release work 
with?
 2.8.x17.05.2
 2.9.x17.11.10
 2.10.x   17.11.10
-2.11.x   18.11.9
+2.11.x   18.11.11
  
 
 Q: Are all the DPDK releases that OVS versions work with maintained?
diff --git a/Documentation/intro/install/dpdk.rst 
b/Documentation/intro/install/dpdk.rst
index f0a7bff..a441715 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -42,7 +42,7 @@ Build requirements
 In addition to the requirements described in :doc:`general`, building Open
 vSwitch with DPDK will require the following:
 
-- DPDK 18.11.9
+- DPDK 18.11.11
 
 - A `DPDK supported NIC`_
 
@@ -71,9 +71,9 @@ Install DPDK
 #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
 
$ cd /usr/src/
-   $ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz
-   $ tar xf dpdk-18.11.9.tar.xz
-   $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.9
+   $ wget http://fast.dpdk.org/rel/dpdk-18.11.11.tar.xz
+   $ tar xf dpdk-18.11.11.tar.xz
+   $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.11
$ cd $DPDK_DIR
 
 #. (Optional) Configure DPDK as a shared library
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index 055cde0..4919797 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -320,9 +320,9 @@ To begin, instantiate a guest as described in 
:ref:`dpdk-vhost-user` or
 DPDK sources to VM and build DPDK::
 
 $ cd /root/dpdk/
-$ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz
-$ tar xf dpdk-18.11.9.tar.xz
-$ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.9
+$ wget http://fast.dpdk.org/rel/dpdk-18.11.11.tar.xz
+$ tar xf dpdk-18.11.11.tar.xz
+$ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.11
 $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
 $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
 $ cd $DPDK_DIR
diff --git a/NEWS b/NEWS
index d6e0523..11a7b40 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 v2.11.7 - xx xxx 
 -
+   - DPDK
+ * OVS validated with DPDK 18.11.11. Due to this being the final release
+   in the DPDK 18.11 series it is recommended to be used.
 
 v2.11.6 - 10 Feb 2021
 -
-- 
2.7.4

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


Re: [ovs-dev] [PATCH 1/2] dpif-netdev: auto load balance log state on user request.

2021-02-12 Thread Ilya Maximets
On 2/12/21 8:33 PM, Kevin Traynor wrote:
> On 12/02/2021 19:17, Ilya Maximets wrote:
>> On 2/12/21 6:39 PM, Stokes, Ian wrote:
 At present the log displays the auto load balance state
 everytime it is changed.

 There are some cases where the user will try to enable
 auto load balance, but it cannot be enabled because not
 enough PMDs or RxQs. As the state does not change, there
 is no new log of the state.

 While the the last log report of state is still correct,
 it is better to log the state again at this point so the
 user can explicitly confirm the outcome of their request.

 Signed-off-by: Kevin Traynor 
>>>
>>> Thanks for the patch Kevin.
>>>
>>> This is a nice improvement to be fair. Have tested a number of cases and 
>>> works as expected.
>>>
>>> LGTM.
>>>
>>> Question is should we include this and patch 2 of the series in OVS 2.15?
>>>
>>> Personally I think it would be worth it. It's not a big change as it's only 
>>> a log trigger and makes the auto-lb more user intuitive.
>>>
>>> @Ilya Maximets what are your thoughts on this?
>>
>> I'm OK with applying to 2.15.  Seems like a good improvement.
>> Didn't test it myself, though.
>>
>> Looking forward for auto-lb unit tests. :)
>>
> 
> Ah, you don't need to look forward - you can look back to yesterday :-)
> 
> https://mail.openvswitch.org/pipermail/ovs-dev/2021-February/380315.html

Oh.  I overlooked that patch somehow.  Thanks for pointing out!

> 
> In fact, as I mentioned, it was writing and running the unit tests that
> identified these gaps in the logs. Who knew unit tests could be helpful.
> 
>>>
>>> Regards
>>> Ian
 ---
  lib/dpif-netdev.c | 4 
  1 file changed, 4 insertions(+)

 diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
 index e3fd0a07f..4381c618f 100644
 --- a/lib/dpif-netdev.c
 +++ b/lib/dpif-netdev.c
 @@ -4347,6 +4347,10 @@ dpif_netdev_set_config(struct dpif *dpif, const
 struct smap *other_config)

  struct pmd_auto_lb *pmd_alb = &dp->pmd_alb;
 +bool cur_rebalance_requested = pmd_alb->auto_lb_requested;
  pmd_alb->auto_lb_requested = smap_get_bool(other_config, 
 "pmd-auto-lb",
false);
 +if (cur_rebalance_requested != pmd_alb->auto_lb_requested) {
 +log_autolb = true;
 +}

  rebalance_intvl = smap_get_int(other_config, 
 "pmd-auto-lb-rebal-interval",
 --
 2.26.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 branch-2.13 v2] dpdk: Use DPDK 19.11.6 release.

2021-02-12 Thread Ilya Maximets
On 2/12/21 8:32 PM, Hariprasad Govindharajan wrote:
> Modify ci linux build script to use the latest DPDK stable release.
> Modify Documentation to use the latest DPDK stable release
> 19.11.6. Update NEWS file to reflect the latest DPDK stable release.
> 
> Note: 19.11.6 is the latest stable release in the 19.11 series.
> So OvS 2.13 is updated to use 19.11.6 version
> 18.11.11 is the final support release for the 18.11 series,
> no further support releases for 18.11 series are expected.
> So, both OvS 2.11 and 2.12 are updated to use 18.11.11.
> 
> Signed-off-by: Hariprasad Govindharajan 
> Acked-by: Kevin Traynor 
> ---
> v2:
> modified NEWS file based on review comments
> ---
>  .ci/linux-build.sh   | 2 +-
>  Documentation/faq/releases.rst   | 6 +++---
>  Documentation/intro/install/dpdk.rst | 8 
>  Documentation/topics/dpdk/vhost-user.rst | 6 +++---
>  NEWS | 7 +++
>  5 files changed, 18 insertions(+), 11 deletions(-)
> 
> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
> index ec0b40e..4a9a20b 100755
> --- a/.ci/linux-build.sh
> +++ b/.ci/linux-build.sh
> @@ -182,7 +182,7 @@ fi
>  
>  if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
>  if [ -z "$DPDK_VER" ]; then
> -DPDK_VER="19.11.2"
> +DPDK_VER="19.11.6"
>  fi
>  install_dpdk $DPDK_VER
>  # Enable pdump support in OVS.
> diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
> index 41e1315..4a0dcac 100644
> --- a/Documentation/faq/releases.rst
> +++ b/Documentation/faq/releases.rst
> @@ -190,9 +190,9 @@ Q: What DPDK version does each Open vSwitch release work 
> with?
>  2.8.x17.05.2
>  2.9.x17.11.10
>  2.10.x   17.11.10
> -2.11.x   18.11.9
> -2.12.x   18.11.9
> -2.13.x   19.11.2
> +2.11.x   18.11.11
> +2.12.x   18.11.11
> +2.13.x   19.11.6
>   
>  
>  Q: Are all the DPDK releases that OVS versions work with maintained?
> diff --git a/Documentation/intro/install/dpdk.rst 
> b/Documentation/intro/install/dpdk.rst
> index 86ee19d..050e554 100644
> --- a/Documentation/intro/install/dpdk.rst
> +++ b/Documentation/intro/install/dpdk.rst
> @@ -42,7 +42,7 @@ Build requirements
>  In addition to the requirements described in :doc:`general`, building Open
>  vSwitch with DPDK will require the following:
>  
> -- DPDK 19.11.2
> +- DPDK 19.11.6
>  
>  - A `DPDK supported NIC`_
>  
> @@ -71,9 +71,9 @@ Install DPDK
>  #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
>  
> $ cd /usr/src/
> -   $ wget https://fast.dpdk.org/rel/dpdk-19.11.2.tar.xz
> -   $ tar xf dpdk-19.11.2.tar.xz
> -   $ export DPDK_DIR=/usr/src/dpdk-stable-19.11.2
> +   $ wget https://fast.dpdk.org/rel/dpdk-19.11.6.tar.xz
> +   $ tar xf dpdk-19.11.6.tar.xz
> +   $ export DPDK_DIR=/usr/src/dpdk-stable-19.11.6
> $ cd $DPDK_DIR
>  
>  #. (Optional) Configure DPDK as a shared library
> diff --git a/Documentation/topics/dpdk/vhost-user.rst 
> b/Documentation/topics/dpdk/vhost-user.rst
> index 4bc5aef..d020115 100644
> --- a/Documentation/topics/dpdk/vhost-user.rst
> +++ b/Documentation/topics/dpdk/vhost-user.rst
> @@ -392,9 +392,9 @@ To begin, instantiate a guest as described in 
> :ref:`dpdk-vhost-user` or
>  DPDK sources to VM and build DPDK::
>  
>  $ cd /root/dpdk/
> -$ wget https://fast.dpdk.org/rel/dpdk-19.11.2.tar.xz
> -$ tar xf dpdk-19.11.2.tar.xz
> -$ export DPDK_DIR=/root/dpdk/dpdk-stable-19.11.2
> +$ wget https://fast.dpdk.org/rel/dpdk-19.11.6.tar.xz
> +$ tar xf dpdk-19.11.6.tar.xz
> +$ export DPDK_DIR=/root/dpdk/dpdk-stable-19.11.6
>  $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
>  $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
>  $ cd $DPDK_DIR
> diff --git a/NEWS b/NEWS
> index 2b35e9f..c937b25 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -1,5 +1,9 @@
>  v2.13.4 - xx xxx 
>  -
> +   - Bug fixes

Please, don't add 'Bug fixes' line.  It's irrelevant to this patch.
And this will also confuse my release automation scripts that actually
adds this line. :)

> +   - DPDK:
> + * OVS validated with DPDK 19.11.6. It is recommended to use this version
> + until further releases.

indentation a bit off.

>  
>  v2.13.3 - 10 Feb 2021
>  -
> @@ -37,6 +41,9 @@ v2.13.1 - 30 Jul 2020
> CVE-2020-10722, CVE-2020-10723, CVE-2020-10724, CVE-2020-10725 and
> CVE-2020-10726, this DPDK version is strongly recommended to be used.
>  
> + * OVS validated with DPDK 19.11.6. It is recommended to use this version
> +   until further releases.
> +

This should not be here.

>  v2.13.0 - 14 Feb 2020
>  -
> - OVN:
> 

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


Re: [ovs-dev] [PATCH 1/2] dpif-netdev: auto load balance log state on user request.

2021-02-12 Thread Kevin Traynor
On 12/02/2021 19:17, Ilya Maximets wrote:
> On 2/12/21 6:39 PM, Stokes, Ian wrote:
>>> At present the log displays the auto load balance state
>>> everytime it is changed.
>>>
>>> There are some cases where the user will try to enable
>>> auto load balance, but it cannot be enabled because not
>>> enough PMDs or RxQs. As the state does not change, there
>>> is no new log of the state.
>>>
>>> While the the last log report of state is still correct,
>>> it is better to log the state again at this point so the
>>> user can explicitly confirm the outcome of their request.
>>>
>>> Signed-off-by: Kevin Traynor 
>>
>> Thanks for the patch Kevin.
>>
>> This is a nice improvement to be fair. Have tested a number of cases and 
>> works as expected.
>>
>> LGTM.
>>
>> Question is should we include this and patch 2 of the series in OVS 2.15?
>>
>> Personally I think it would be worth it. It's not a big change as it's only 
>> a log trigger and makes the auto-lb more user intuitive.
>>
>> @Ilya Maximets what are your thoughts on this?
> 
> I'm OK with applying to 2.15.  Seems like a good improvement.
> Didn't test it myself, though.
> 
> Looking forward for auto-lb unit tests. :)
> 

Ah, you don't need to look forward - you can look back to yesterday :-)

https://mail.openvswitch.org/pipermail/ovs-dev/2021-February/380315.html

In fact, as I mentioned, it was writing and running the unit tests that
identified these gaps in the logs. Who knew unit tests could be helpful.

>>
>> Regards
>> Ian
>>> ---
>>>  lib/dpif-netdev.c | 4 
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>>> index e3fd0a07f..4381c618f 100644
>>> --- a/lib/dpif-netdev.c
>>> +++ b/lib/dpif-netdev.c
>>> @@ -4347,6 +4347,10 @@ dpif_netdev_set_config(struct dpif *dpif, const
>>> struct smap *other_config)
>>>
>>>  struct pmd_auto_lb *pmd_alb = &dp->pmd_alb;
>>> +bool cur_rebalance_requested = pmd_alb->auto_lb_requested;
>>>  pmd_alb->auto_lb_requested = smap_get_bool(other_config, "pmd-auto-lb",
>>>false);
>>> +if (cur_rebalance_requested != pmd_alb->auto_lb_requested) {
>>> +log_autolb = true;
>>> +}
>>>
>>>  rebalance_intvl = smap_get_int(other_config, 
>>> "pmd-auto-lb-rebal-interval",
>>> --
>>> 2.26.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


[ovs-dev] [PATCH branch-2.13 v2] dpdk: Use DPDK 19.11.6 release.

2021-02-12 Thread Hariprasad Govindharajan
Modify ci linux build script to use the latest DPDK stable release.
Modify Documentation to use the latest DPDK stable release
19.11.6. Update NEWS file to reflect the latest DPDK stable release.

Note: 19.11.6 is the latest stable release in the 19.11 series.
So OvS 2.13 is updated to use 19.11.6 version
18.11.11 is the final support release for the 18.11 series,
no further support releases for 18.11 series are expected.
So, both OvS 2.11 and 2.12 are updated to use 18.11.11.

Signed-off-by: Hariprasad Govindharajan 
Acked-by: Kevin Traynor 
---
v2:
modified NEWS file based on review comments
---
 .ci/linux-build.sh   | 2 +-
 Documentation/faq/releases.rst   | 6 +++---
 Documentation/intro/install/dpdk.rst | 8 
 Documentation/topics/dpdk/vhost-user.rst | 6 +++---
 NEWS | 7 +++
 5 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index ec0b40e..4a9a20b 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -182,7 +182,7 @@ fi
 
 if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="19.11.2"
+DPDK_VER="19.11.6"
 fi
 install_dpdk $DPDK_VER
 # Enable pdump support in OVS.
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 41e1315..4a0dcac 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -190,9 +190,9 @@ Q: What DPDK version does each Open vSwitch release work 
with?
 2.8.x17.05.2
 2.9.x17.11.10
 2.10.x   17.11.10
-2.11.x   18.11.9
-2.12.x   18.11.9
-2.13.x   19.11.2
+2.11.x   18.11.11
+2.12.x   18.11.11
+2.13.x   19.11.6
  
 
 Q: Are all the DPDK releases that OVS versions work with maintained?
diff --git a/Documentation/intro/install/dpdk.rst 
b/Documentation/intro/install/dpdk.rst
index 86ee19d..050e554 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -42,7 +42,7 @@ Build requirements
 In addition to the requirements described in :doc:`general`, building Open
 vSwitch with DPDK will require the following:
 
-- DPDK 19.11.2
+- DPDK 19.11.6
 
 - A `DPDK supported NIC`_
 
@@ -71,9 +71,9 @@ Install DPDK
 #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
 
$ cd /usr/src/
-   $ wget https://fast.dpdk.org/rel/dpdk-19.11.2.tar.xz
-   $ tar xf dpdk-19.11.2.tar.xz
-   $ export DPDK_DIR=/usr/src/dpdk-stable-19.11.2
+   $ wget https://fast.dpdk.org/rel/dpdk-19.11.6.tar.xz
+   $ tar xf dpdk-19.11.6.tar.xz
+   $ export DPDK_DIR=/usr/src/dpdk-stable-19.11.6
$ cd $DPDK_DIR
 
 #. (Optional) Configure DPDK as a shared library
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index 4bc5aef..d020115 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -392,9 +392,9 @@ To begin, instantiate a guest as described in 
:ref:`dpdk-vhost-user` or
 DPDK sources to VM and build DPDK::
 
 $ cd /root/dpdk/
-$ wget https://fast.dpdk.org/rel/dpdk-19.11.2.tar.xz
-$ tar xf dpdk-19.11.2.tar.xz
-$ export DPDK_DIR=/root/dpdk/dpdk-stable-19.11.2
+$ wget https://fast.dpdk.org/rel/dpdk-19.11.6.tar.xz
+$ tar xf dpdk-19.11.6.tar.xz
+$ export DPDK_DIR=/root/dpdk/dpdk-stable-19.11.6
 $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
 $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
 $ cd $DPDK_DIR
diff --git a/NEWS b/NEWS
index 2b35e9f..c937b25 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
 v2.13.4 - xx xxx 
 -
+   - Bug fixes
+   - DPDK:
+ * OVS validated with DPDK 19.11.6. It is recommended to use this version
+ until further releases.
 
 v2.13.3 - 10 Feb 2021
 -
@@ -37,6 +41,9 @@ v2.13.1 - 30 Jul 2020
CVE-2020-10722, CVE-2020-10723, CVE-2020-10724, CVE-2020-10725 and
CVE-2020-10726, this DPDK version is strongly recommended to be used.
 
+ * OVS validated with DPDK 19.11.6. It is recommended to use this version
+   until further releases.
+
 v2.13.0 - 14 Feb 2020
 -
- OVN:
-- 
2.7.4

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


[ovs-dev] [PATCH branch-2.12 v2] dpdk: Use DPDK 18.11.11 release.

2021-02-12 Thread Hariprasad Govindharajan
Modify ci linux build script to use the latest DPDK stable release.
Modify Documentation to use the latest DPDK stable release
18.11.11. Update NEWS file to reflect the latest DPDK stable
release.

Note: 18.11.11 is the final support release for the 18.11 series,
no further support releases for 18.11 series are expected.
So, both OvS 2.11 and 2.12 are updated to use 18.11.11.

Signed-off-by: Hariprasad Govindharajan 
Acked-by: Kevin Traynor 
---
v2:
modified commit message and NEWS file based on review comments
---
 .ci/linux-build.sh   | 2 +-
 Documentation/faq/releases.rst   | 4 ++--
 Documentation/intro/install/dpdk.rst | 8 
 Documentation/topics/dpdk/vhost-user.rst | 6 +++---
 NEWS | 4 
 5 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index e67d889..e4a944c 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -107,7 +107,7 @@ fi
 
 if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="18.11.9"
+DPDK_VER="18.11.11"
 fi
 install_dpdk $DPDK_VER
 if [ "$CC" = "clang" ]; then
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 5a51dbc..a0a403f 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -178,8 +178,8 @@ Q: What DPDK version does each Open vSwitch release work 
with?
 2.8.x17.05.2
 2.9.x17.11.10
 2.10.x   17.11.10
-2.11.x   18.11.9
-2.12.x   18.11.9
+2.11.x   18.11.11
+2.12.x   18.11.11
  
 
 Q: Are all the DPDK releases that OVS versions work with maintained?
diff --git a/Documentation/intro/install/dpdk.rst 
b/Documentation/intro/install/dpdk.rst
index f0a7bff..a441715 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -42,7 +42,7 @@ Build requirements
 In addition to the requirements described in :doc:`general`, building Open
 vSwitch with DPDK will require the following:
 
-- DPDK 18.11.9
+- DPDK 18.11.11
 
 - A `DPDK supported NIC`_
 
@@ -71,9 +71,9 @@ Install DPDK
 #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
 
$ cd /usr/src/
-   $ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz
-   $ tar xf dpdk-18.11.9.tar.xz
-   $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.9
+   $ wget http://fast.dpdk.org/rel/dpdk-18.11.11.tar.xz
+   $ tar xf dpdk-18.11.11.tar.xz
+   $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.11
$ cd $DPDK_DIR
 
 #. (Optional) Configure DPDK as a shared library
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index 2253978..0155512 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -392,9 +392,9 @@ To begin, instantiate a guest as described in 
:ref:`dpdk-vhost-user` or
 DPDK sources to VM and build DPDK::
 
 $ cd /root/dpdk/
-$ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz
-$ tar xf dpdk-18.11.9.tar.xz
-$ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.9
+$ wget http://fast.dpdk.org/rel/dpdk-18.11.11.tar.xz
+$ tar xf dpdk-18.11.11.tar.xz
+$ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.11
 $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
 $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
 $ cd $DPDK_DIR
diff --git a/NEWS b/NEWS
index e5a41cb..5ba0404 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
 v2.12.4 - xx xxx 
 -
+   - Bug fixes
+   - DPDK:
+ * OVS validated with DPDK 18.11.11. Due to this being the final release
+   in the DPDK 18.11 series it is recommended it to be used.
 
 v2.12.3 - 10 Feb 2021
 -
-- 
2.7.4

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


Re: [ovs-dev] [PATCH 2/2] dpif-netdev: auto load balance improve enable/disable logs.

2021-02-12 Thread Kevin Traynor
On 12/02/2021 17:42, Stokes, Ian wrote:
>> In order for auto load balance to be enabled, there are
>> minimum requirements of more than one PMD and more than
>> one Rxq on at least one PMD.
>>
>> If these conditions are not met a rebalance would be pointless,
>> so auto load balance is not enabled.
>>
>> Currently the state is logged but in the case where the criteria
>> for enabling is not met, there is no reason given.
>>
>> It would be useful for the user to see the reason, so they
>> can understand why auto load balance has not been enabled
>> when they have requested it.
>>
>> For example, if a user has one PMD and sets pmd-auto-lb=true,
>> previously:
>> |INFO|PMD auto load balance is disabled
>>
>> With patch:
>> |INFO|PMD auto load balance not enough PMDs or Rx Queues to enable
>> |INFO|PMD auto load balance is disabled
> 
> Thanks for the patch Kevin.
> 
> In testing this worked as expected.
> 
> One query I had was did you give thought towards more detailed in the log?
> 

I hadn't thought about splitting them. They are both connected as
increasing the PMDs, will reduce the number of RxQ's per PMD etc. so
it's hard to be prescriptive in splitting them to tell the user exactly
what they need to change.
e.g.
2 rxq on 1 pmd "not enough PMDs"
user increases pmds to 2
1 rxq on 2 pmds "not enough rxqs"

They'd get there in the end, but I wonder if it would be more annoying
to get a new message after fixing the only one that was reported first
time around :-)

> i.e. if its 1 PMD should we flag that PMD <=1 is an issue.
> 
> Similar with the number of RXQs.
> 
> Maybe that's overkill as you could argue the minimum requirements could 
> change over time but if its something that could be flagged easily would it 
> be worth it?
> 

At the moment it's easily added, with the caveat as per above that just
saying pmds or rxqs alone may not give the full picture. You are right
that the minimum requirements could change a bit in time, so we could
end up with further interconnected min reqs which might make it more
difficult to split.

If you think it's useful, I'm fine to add now, or else we can go with a
single line now and review again later when there is more development on
it and docs are improved etc.

> Thanks
> Ian
>>
>> Signed-off-by: Kevin Traynor 
>> ---
>>  lib/dpif-netdev.c | 19 +++
>>  1 file changed, 15 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>> index 4381c618f..833f45616 100644
>> --- a/lib/dpif-netdev.c
>> +++ b/lib/dpif-netdev.c
>> @@ -4213,4 +4213,5 @@ set_pmd_auto_lb(struct dp_netdev *dp, bool
>> always_log)
>>  bool enable_alb = false;
>>  bool multi_rxq = false;
>> +bool minreq = false;
>>  bool pmd_rxq_assign_cyc = dp->pmd_rxq_assign_cyc;
>>
>> @@ -4226,6 +4227,6 @@ set_pmd_auto_lb(struct dp_netdev *dp, bool
>> always_log)
>>  }
>>  if (cnt && multi_rxq) {
>> -enable_alb = true;
>> -break;
>> +minreq = true;
>> +break;
>>  }
>>  cnt++;
>> @@ -4233,6 +4234,5 @@ set_pmd_auto_lb(struct dp_netdev *dp, bool
>> always_log)
>>
>>  /* Enable auto LB if it is requested and cycle based assignment is 
>> true. */
>> -enable_alb = enable_alb && pmd_rxq_assign_cyc &&
>> -pmd_alb->auto_lb_requested;
>> +enable_alb = minreq && pmd_rxq_assign_cyc && pmd_alb-
>>> auto_lb_requested;
>>
>>  if (pmd_alb->is_enabled != enable_alb || always_log) {
>> @@ -4251,4 +4251,15 @@ set_pmd_auto_lb(struct dp_netdev *dp, bool
>> always_log)
>>  } else {
>>  pmd_alb->rebalance_poll_timer = 0;
>> +if (pmd_alb->auto_lb_requested) {
>> +if (!minreq) {
>> +VLOG_INFO("PMD auto load balance not enough "
>> +  "PMDs or Rx Queues to enable");
>> +}
>> +if (!pmd_rxq_assign_cyc) {
>> +VLOG_INFO("PMD auto load balance needs "
>> +  "'other_config:pmd-rxq-assign=cycles' "
>> +  "to enable");
>> +}
>> +}
>>  VLOG_INFO("PMD auto load balance is disabled");
>>  }
>> --
>> 2.26.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 1/2] dpif-netdev: auto load balance log state on user request.

2021-02-12 Thread Ilya Maximets
On 2/12/21 6:39 PM, Stokes, Ian wrote:
>> At present the log displays the auto load balance state
>> everytime it is changed.
>>
>> There are some cases where the user will try to enable
>> auto load balance, but it cannot be enabled because not
>> enough PMDs or RxQs. As the state does not change, there
>> is no new log of the state.
>>
>> While the the last log report of state is still correct,
>> it is better to log the state again at this point so the
>> user can explicitly confirm the outcome of their request.
>>
>> Signed-off-by: Kevin Traynor 
> 
> Thanks for the patch Kevin.
> 
> This is a nice improvement to be fair. Have tested a number of cases and 
> works as expected.
> 
> LGTM.
> 
> Question is should we include this and patch 2 of the series in OVS 2.15?
> 
> Personally I think it would be worth it. It's not a big change as it's only a 
> log trigger and makes the auto-lb more user intuitive.
> 
> @Ilya Maximets what are your thoughts on this?

I'm OK with applying to 2.15.  Seems like a good improvement.
Didn't test it myself, though.

Looking forward for auto-lb unit tests. :)

> 
> Regards
> Ian
>> ---
>>  lib/dpif-netdev.c | 4 
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>> index e3fd0a07f..4381c618f 100644
>> --- a/lib/dpif-netdev.c
>> +++ b/lib/dpif-netdev.c
>> @@ -4347,6 +4347,10 @@ dpif_netdev_set_config(struct dpif *dpif, const
>> struct smap *other_config)
>>
>>  struct pmd_auto_lb *pmd_alb = &dp->pmd_alb;
>> +bool cur_rebalance_requested = pmd_alb->auto_lb_requested;
>>  pmd_alb->auto_lb_requested = smap_get_bool(other_config, "pmd-auto-lb",
>>false);
>> +if (cur_rebalance_requested != pmd_alb->auto_lb_requested) {
>> +log_autolb = true;
>> +}
>>
>>  rebalance_intvl = smap_get_int(other_config, 
>> "pmd-auto-lb-rebal-interval",
>> --
>> 2.26.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] pcap-file: Fix calculation of TCP payload length in tcp_reader_run().

2021-02-12 Thread William Tu
On Tue, Feb 2, 2021 at 10:00 AM Ben Pfaff  wrote:
>
> On Tue, Feb 02, 2021 at 05:11:09PM +0100, Ilya Maximets wrote:
> > On 1/21/21 11:33 PM, Ben Pfaff wrote:
> > > The calculation in tcp_reader_run() failed to account for L2 padding.
> > > This fixes the problem, by moving the existing function
> > > tcp_payload_length() from a conntrack private header file into
> > > dp-packet.h and renaming it to suit the dp_packet style.
> > >
> > > Signed-off-by: Ben Pfaff 
> > > ---
> >
> > LGTM,
> > Acked-by: Ilya Maximets 
>
> Thanks, applied to master.

Hi Ben and Ilya,

I'm confused with what l2_pad_size is.
I thought it's between L2 and L3 header, there is a 2-byte padding to
make it 16-byte alignment. But it doesn't look like that.

Then every time dp_packet API use dp_packet_tail, we have to
subtract the l2_pad_size. ex: dp_packet_l4_size()
So is thie l2_pad_size the extra byte at the end of buffer? (before the
memory pointed by dp_packet_tail(p)?

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


Re: [ovs-dev] [PATCH branch-2.11 v2] dpdk: Use DPDK 18.11.11 release.

2021-02-12 Thread 0-day Robot
Bleep bloop.  Greetings Hariprasad Govindharajan, I am a robot and I have tried 
out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


git-am:
.git/rebase-apply/patch:89: trailing whitespace.
   - DPDK  
warning: 1 line adds whitespace errors.


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH ovn] controller: introduce coverage_counters for ovn-controller incremental processing

2021-02-12 Thread Lorenzo Bianconi
In order to help understanding system behaviour for debugging purpose,
introduce coverage counters for ovn-controller I-P engine.

https://bugzilla.redhat.com/show_bug.cgi?id=1890902
Signed-off-by: Lorenzo Bianconi 
---
 controller/ovn-controller.c | 77 +++--
 lib/inc-proc-eng.h  | 13 +++
 2 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index 61b809593..0650fe353 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -17,6 +17,8 @@
 
 #include "ovn-controller.h"
 
+#include "coverage.h"
+
 #include 
 #include 
 #include 
@@ -85,6 +87,30 @@ static unixctl_cb_func lflow_cache_flush_cmd;
 static unixctl_cb_func lflow_cache_show_stats_cmd;
 static unixctl_cb_func debug_delay_nb_cfg_report;
 
+ENGINE_DEF_COVERAGE(flow_output);
+ENGINE_CHANGE_COVERAGE(flow_output_runtime_data);
+ENGINE_CHANGE_COVERAGE(flow_output_addr_sets);
+ENGINE_CHANGE_COVERAGE(flow_output_port_groups);
+ENGINE_CHANGE_COVERAGE(flow_output_physical_flow_changes);
+ENGINE_CHANGE_COVERAGE(flow_output_sb_multicast_group);
+ENGINE_CHANGE_COVERAGE(flow_output_sb_port_binding);
+ENGINE_CHANGE_COVERAGE(flow_output_sb_mac_binding);
+ENGINE_CHANGE_COVERAGE(flow_output_sb_logical_flow);
+ENGINE_CHANGE_COVERAGE(flow_output_sb_load_balancer);
+
+ENGINE_DEF_COVERAGE(runtime_data);
+ENGINE_CHANGE_COVERAGE(runtime_data_sb_datapath_binding);
+ENGINE_CHANGE_COVERAGE(runtime_data_sb_port_binding);
+
+ENGINE_DEF_COVERAGE(addr_sets);
+ENGINE_CHANGE_COVERAGE(addr_sets_sb_address_set);
+
+ENGINE_DEF_COVERAGE(port_groups);
+ENGINE_DEF_COVERAGE(ct_zones);
+ENGINE_DEF_COVERAGE(mff_ovn_geneve);
+ENGINE_DEF_COVERAGE(ofctrl_is_connected);
+ENGINE_DEF_COVERAGE(physical_flow_changes);
+
 #define DEFAULT_BRIDGE_NAME "br-int"
 #define DEFAULT_PROBE_INTERVAL_MSEC 5000
 #define OFCTRL_DEFAULT_PROBE_INTERVAL_SEC 0
@@ -944,6 +970,10 @@ ctrl_register_ovs_idl(struct ovsdb_idl *ovs_idl)
 SB_NODE(dns, "dns") \
 SB_NODE(load_balancer, "load_balancer")
 
+#define SB_NODE(NAME, NAME_STR) ENGINE_DEF_COVERAGE(sb_##NAME);
+SB_NODES
+#undef SB_NODE
+
 enum sb_engine_node {
 #define SB_NODE(NAME, NAME_STR) SB_##NAME,
 SB_NODES
@@ -961,6 +991,10 @@ enum sb_engine_node {
 OVS_NODE(interface, "interface") \
 OVS_NODE(qos, "qos")
 
+#define OVS_NODE(NAME, NAME_STR) ENGINE_DEF_COVERAGE(ovs_##NAME);
+OVS_NODES
+#undef OVS_NODE
+
 enum ovs_engine_node {
 #define OVS_NODE(NAME, NAME_STR) OVS_##NAME,
 OVS_NODES
@@ -1000,6 +1034,7 @@ en_ofctrl_is_connected_run(struct engine_node *node, void 
*data)
 ofctrl_seqno_flush();
 binding_seqno_flush();
 }
+ENGINE_COVERAGE_INC(ofctrl_is_connected);
 engine_set_node_state(node, EN_UPDATED);
 return;
 }
@@ -1056,6 +1091,7 @@ en_addr_sets_run(struct engine_node *node, void *data)
 addr_sets_init(as_table, &as->addr_sets);
 
 as->change_tracked = false;
+ENGINE_COVERAGE_INC(addr_sets);
 engine_set_node_state(node, EN_UPDATED);
 }
 
@@ -1083,6 +1119,7 @@ addr_sets_sb_address_set_handler(struct engine_node 
*node, void *data)
 }
 
 as->change_tracked = true;
+ENGINE_CHANGE_COVERAGE_INC(addr_sets_sb_address_set);
 return true;
 }
 
@@ -1136,6 +1173,7 @@ en_port_groups_run(struct engine_node *node, void *data)
 port_groups_init(pg_table, &pg->port_groups);
 
 pg->change_tracked = false;
+ENGINE_COVERAGE_INC(port_groups);
 engine_set_node_state(node, EN_UPDATED);
 }
 
@@ -1471,6 +1509,7 @@ en_runtime_data_run(struct engine_node *node, void *data)
 
 binding_run(&b_ctx_in, &b_ctx_out);
 
+ENGINE_COVERAGE_INC(runtime_data);
 engine_set_node_state(node, EN_UPDATED);
 }
 
@@ -1519,6 +1558,7 @@ runtime_data_sb_port_binding_handler(struct engine_node 
*node, void *data)
 !hmap_is_empty(b_ctx_out.tracked_dp_bindings)) {
 engine_set_node_state(node, EN_UPDATED);
 }
+ENGINE_CHANGE_COVERAGE_INC(runtime_data_sb_port_binding);
 
 return true;
 }
@@ -1541,6 +1581,7 @@ runtime_data_sb_datapath_binding_handler(struct 
engine_node *node OVS_UNUSED,
 }
 }
 }
+ENGINE_CHANGE_COVERAGE_INC(runtime_data_sb_datapath_binding);
 
 return true;
 }
@@ -1593,7 +1634,7 @@ en_ct_zones_run(struct engine_node *node, void *data)
 &ct_zones_data->current, ct_zones_data->bitmap,
 &ct_zones_data->pending, &rt_data->ct_updated_datapaths);
 
-
+ENGINE_COVERAGE_INC(ct_zones);
 engine_set_node_state(node, EN_UPDATED);
 }
 
@@ -1629,6 +1670,7 @@ en_mff_ovn_geneve_run(struct engine_node *node, void 
*data)
 if (ed_mff_ovn_geneve->mff_ovn_geneve != mff_ovn_geneve) {
 ed_mff_ovn_geneve->mff_ovn_geneve = mff_ovn_geneve;
 engine_set_node_state(node, EN_UPDATED);
+ENGINE_COVERAGE_INC(mff_ovn_geneve);
 return;
 }
 engine_set_node_state(node, EN_UNCHANGED);
@@ -1703,6 +1745,

[ovs-dev] [PATCH branch-2.11 v3] dpdk: Use DPDK 18.11.11 release.

2021-02-12 Thread Hariprasad Govindharajan
Modify ci linux build script to use the latest DPDK stable release.
Modify Documentation to use the latest DPDK stable release
18.11.11. Update NEWS file to reflect the latest DPDK stable
release.

Note: 18.11.11 is the final support release for the 18.11 series,
no further support releases for 18.11 series are expected.

Signed-off-by: Hariprasad Govindharajan 
Acked-by: Kevin Traynor 
---
v3:
fixed alignment issue in the NEWS file
v2:
modified NEWS file based on review comments
---
 .ci/linux-build.sh   | 2 +-
 Documentation/faq/releases.rst   | 2 +-
 Documentation/intro/install/dpdk.rst | 8 
 Documentation/topics/dpdk/vhost-user.rst | 6 +++---
 NEWS | 4 
 5 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index ab0089d..61b7374 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -88,7 +88,7 @@ fi
 
 if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="18.11.9"
+DPDK_VER="18.11.11"
 fi
 install_dpdk $DPDK_VER
 if [ "$CC" = "clang" ]; then
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 302da72..d6a93b9 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -176,7 +176,7 @@ Q: What DPDK version does each Open vSwitch release work 
with?
 2.8.x17.05.2
 2.9.x17.11.10
 2.10.x   17.11.10
-2.11.x   18.11.9
+2.11.x   18.11.11
  
 
 Q: Are all the DPDK releases that OVS versions work with maintained?
diff --git a/Documentation/intro/install/dpdk.rst 
b/Documentation/intro/install/dpdk.rst
index f0a7bff..a441715 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -42,7 +42,7 @@ Build requirements
 In addition to the requirements described in :doc:`general`, building Open
 vSwitch with DPDK will require the following:
 
-- DPDK 18.11.9
+- DPDK 18.11.11
 
 - A `DPDK supported NIC`_
 
@@ -71,9 +71,9 @@ Install DPDK
 #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
 
$ cd /usr/src/
-   $ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz
-   $ tar xf dpdk-18.11.9.tar.xz
-   $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.9
+   $ wget http://fast.dpdk.org/rel/dpdk-18.11.11.tar.xz
+   $ tar xf dpdk-18.11.11.tar.xz
+   $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.11
$ cd $DPDK_DIR
 
 #. (Optional) Configure DPDK as a shared library
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index 055cde0..4919797 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -320,9 +320,9 @@ To begin, instantiate a guest as described in 
:ref:`dpdk-vhost-user` or
 DPDK sources to VM and build DPDK::
 
 $ cd /root/dpdk/
-$ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz
-$ tar xf dpdk-18.11.9.tar.xz
-$ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.9
+$ wget http://fast.dpdk.org/rel/dpdk-18.11.11.tar.xz
+$ tar xf dpdk-18.11.11.tar.xz
+$ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.11
 $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
 $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
 $ cd $DPDK_DIR
diff --git a/NEWS b/NEWS
index 531ce37..08a2430 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
 v2.11.6 - xx xxx 
 -
+   - Bug fixes
+   - DPDK
+ * OVS validated with DPDK 18.11.11. Due to this being the final release
+   in the DPDK 18.11 series it is recommended to be used.
 
 v2.11.5 - 13 Jan 2021
 -
-- 
2.7.4

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


Re: [ovs-dev] [PATCH 2/2] dpif-netdev: auto load balance improve enable/disable logs.

2021-02-12 Thread Stokes, Ian
> In order for auto load balance to be enabled, there are
> minimum requirements of more than one PMD and more than
> one Rxq on at least one PMD.
> 
> If these conditions are not met a rebalance would be pointless,
> so auto load balance is not enabled.
> 
> Currently the state is logged but in the case where the criteria
> for enabling is not met, there is no reason given.
> 
> It would be useful for the user to see the reason, so they
> can understand why auto load balance has not been enabled
> when they have requested it.
> 
> For example, if a user has one PMD and sets pmd-auto-lb=true,
> previously:
> |INFO|PMD auto load balance is disabled
> 
> With patch:
> |INFO|PMD auto load balance not enough PMDs or Rx Queues to enable
> |INFO|PMD auto load balance is disabled

Thanks for the patch Kevin.

In testing this worked as expected.

One query I had was did you give thought towards more detailed in the log?

i.e. if its 1 PMD should we flag that PMD <=1 is an issue.

Similar with the number of RXQs.

Maybe that's overkill as you could argue the minimum requirements could change 
over time but if its something that could be flagged easily would it be worth 
it?

Thanks
Ian
> 
> Signed-off-by: Kevin Traynor 
> ---
>  lib/dpif-netdev.c | 19 +++
>  1 file changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 4381c618f..833f45616 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -4213,4 +4213,5 @@ set_pmd_auto_lb(struct dp_netdev *dp, bool
> always_log)
>  bool enable_alb = false;
>  bool multi_rxq = false;
> +bool minreq = false;
>  bool pmd_rxq_assign_cyc = dp->pmd_rxq_assign_cyc;
> 
> @@ -4226,6 +4227,6 @@ set_pmd_auto_lb(struct dp_netdev *dp, bool
> always_log)
>  }
>  if (cnt && multi_rxq) {
> -enable_alb = true;
> -break;
> +minreq = true;
> +break;
>  }
>  cnt++;
> @@ -4233,6 +4234,5 @@ set_pmd_auto_lb(struct dp_netdev *dp, bool
> always_log)
> 
>  /* Enable auto LB if it is requested and cycle based assignment is true. 
> */
> -enable_alb = enable_alb && pmd_rxq_assign_cyc &&
> -pmd_alb->auto_lb_requested;
> +enable_alb = minreq && pmd_rxq_assign_cyc && pmd_alb-
> >auto_lb_requested;
> 
>  if (pmd_alb->is_enabled != enable_alb || always_log) {
> @@ -4251,4 +4251,15 @@ set_pmd_auto_lb(struct dp_netdev *dp, bool
> always_log)
>  } else {
>  pmd_alb->rebalance_poll_timer = 0;
> +if (pmd_alb->auto_lb_requested) {
> +if (!minreq) {
> +VLOG_INFO("PMD auto load balance not enough "
> +  "PMDs or Rx Queues to enable");
> +}
> +if (!pmd_rxq_assign_cyc) {
> +VLOG_INFO("PMD auto load balance needs "
> +  "'other_config:pmd-rxq-assign=cycles' "
> +  "to enable");
> +}
> +}
>  VLOG_INFO("PMD auto load balance is disabled");
>  }
> --
> 2.26.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 1/2] dpif-netdev: auto load balance log state on user request.

2021-02-12 Thread Stokes, Ian
> At present the log displays the auto load balance state
> everytime it is changed.
> 
> There are some cases where the user will try to enable
> auto load balance, but it cannot be enabled because not
> enough PMDs or RxQs. As the state does not change, there
> is no new log of the state.
> 
> While the the last log report of state is still correct,
> it is better to log the state again at this point so the
> user can explicitly confirm the outcome of their request.
> 
> Signed-off-by: Kevin Traynor 

Thanks for the patch Kevin.

This is a nice improvement to be fair. Have tested a number of cases and works 
as expected.

LGTM.

Question is should we include this and patch 2 of the series in OVS 2.15?

Personally I think it would be worth it. It's not a big change as it's only a 
log trigger and makes the auto-lb more user intuitive.

@Ilya Maximets what are your thoughts on this?

Regards
Ian
> ---
>  lib/dpif-netdev.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index e3fd0a07f..4381c618f 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -4347,6 +4347,10 @@ dpif_netdev_set_config(struct dpif *dpif, const
> struct smap *other_config)
> 
>  struct pmd_auto_lb *pmd_alb = &dp->pmd_alb;
> +bool cur_rebalance_requested = pmd_alb->auto_lb_requested;
>  pmd_alb->auto_lb_requested = smap_get_bool(other_config, "pmd-auto-lb",
>false);
> +if (cur_rebalance_requested != pmd_alb->auto_lb_requested) {
> +log_autolb = true;
> +}
> 
>  rebalance_intvl = smap_get_int(other_config, 
> "pmd-auto-lb-rebal-interval",
> --
> 2.26.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


[ovs-dev] [PATCH branch-2.11 v2] dpdk: Use DPDK 18.11.11 release.

2021-02-12 Thread Hariprasad Govindharajan
Modify ci linux build script to use the latest DPDK stable release.
Modify Documentation to use the latest DPDK stable release
18.11.11. Update NEWS file to reflect the latest DPDK stable
release.

Note: 18.11.11 is the final support release for the 18.11 series,
no further support releases for 18.11 series are expected.

Signed-off-by: Hariprasad Govindharajan 
Acked-by: Kevin Traynor 
---
v2:
modified NEWS file based on review comments
---
 .ci/linux-build.sh   | 2 +-
 Documentation/faq/releases.rst   | 2 +-
 Documentation/intro/install/dpdk.rst | 8 
 Documentation/topics/dpdk/vhost-user.rst | 6 +++---
 NEWS | 4 
 5 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index ab0089d..61b7374 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -88,7 +88,7 @@ fi
 
 if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="18.11.9"
+DPDK_VER="18.11.11"
 fi
 install_dpdk $DPDK_VER
 if [ "$CC" = "clang" ]; then
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 302da72..d6a93b9 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -176,7 +176,7 @@ Q: What DPDK version does each Open vSwitch release work 
with?
 2.8.x17.05.2
 2.9.x17.11.10
 2.10.x   17.11.10
-2.11.x   18.11.9
+2.11.x   18.11.11
  
 
 Q: Are all the DPDK releases that OVS versions work with maintained?
diff --git a/Documentation/intro/install/dpdk.rst 
b/Documentation/intro/install/dpdk.rst
index f0a7bff..a441715 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -42,7 +42,7 @@ Build requirements
 In addition to the requirements described in :doc:`general`, building Open
 vSwitch with DPDK will require the following:
 
-- DPDK 18.11.9
+- DPDK 18.11.11
 
 - A `DPDK supported NIC`_
 
@@ -71,9 +71,9 @@ Install DPDK
 #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
 
$ cd /usr/src/
-   $ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz
-   $ tar xf dpdk-18.11.9.tar.xz
-   $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.9
+   $ wget http://fast.dpdk.org/rel/dpdk-18.11.11.tar.xz
+   $ tar xf dpdk-18.11.11.tar.xz
+   $ export DPDK_DIR=/usr/src/dpdk-stable-18.11.11
$ cd $DPDK_DIR
 
 #. (Optional) Configure DPDK as a shared library
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index 055cde0..4919797 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -320,9 +320,9 @@ To begin, instantiate a guest as described in 
:ref:`dpdk-vhost-user` or
 DPDK sources to VM and build DPDK::
 
 $ cd /root/dpdk/
-$ wget http://fast.dpdk.org/rel/dpdk-18.11.9.tar.xz
-$ tar xf dpdk-18.11.9.tar.xz
-$ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.9
+$ wget http://fast.dpdk.org/rel/dpdk-18.11.11.tar.xz
+$ tar xf dpdk-18.11.11.tar.xz
+$ export DPDK_DIR=/root/dpdk/dpdk-stable-18.11.11
 $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
 $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
 $ cd $DPDK_DIR
diff --git a/NEWS b/NEWS
index 531ce37..34674d6 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
 v2.11.6 - xx xxx 
 -
+   - Bug fixes
+   - DPDK  
+ * OVS validated with DPDK 18.11.11. Due to this being the final release
+   in the DPDK 18.11 series it is recommended to be used.
 
 v2.11.5 - 13 Jan 2021
 -
-- 
2.7.4

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


[ovs-dev] [PATCH v9 16/16] dpif-netdev: POC of future DPIF and MFEX AVX512 optimizations

2021-02-12 Thread Harry van Haaren
This is a POC patch, showing future DPIF and MFEX optimizations.

The main optimization is doing MiniflowExtract in AVX512. This speeds
up the specific protocol parsing a lot.

Other optimizations for DPIF show value in removing complexity from
the code by specialization. In particular if only DPCLS is enabled,
we can avoid rebatching packets.

Signed-off-by: Harry van Haaren 
---
 lib/automake.mk  |   1 +
 lib/dpdk.c   |   1 +
 lib/dpif-netdev-avx512.c | 178 +--
 lib/dpif-netdev-private-dpif.h   |   6 ++
 lib/dpif-netdev-private-thread.h |  10 ++
 lib/flow_avx512.h| 117 
 6 files changed, 255 insertions(+), 58 deletions(-)
 create mode 100644 lib/flow_avx512.h

diff --git a/lib/automake.mk b/lib/automake.mk
index 5e493ebaf..a5dbf7f7e 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -137,6 +137,7 @@ lib_libopenvswitch_la_SOURCES = \
lib/fatal-signal.h \
lib/flow.c \
lib/flow.h \
+   lib/flow_avx512.h \
lib/guarded-list.c \
lib/guarded-list.h \
lib/hash.c \
diff --git a/lib/dpdk.c b/lib/dpdk.c
index a9494a40f..a82ff04b6 100644
--- a/lib/dpdk.c
+++ b/lib/dpdk.c
@@ -655,6 +655,7 @@ dpdk_get_cpu_has_isa(const char *arch, const char *feature)
 #if __x86_64__
 /* CPU flags only defined for the architecture that support it. */
 CHECK_CPU_FEATURE(feature, "avx512f", RTE_CPUFLAG_AVX512F);
+CHECK_CPU_FEATURE(feature, "avx512vbmi", RTE_CPUFLAG_AVX512VBMI);
 CHECK_CPU_FEATURE(feature, "avx512vpopcntdq", RTE_CPUFLAG_AVX512VPOPCNTDQ);
 CHECK_CPU_FEATURE(feature, "bmi2", RTE_CPUFLAG_BMI2);
 #endif
diff --git a/lib/dpif-netdev-avx512.c b/lib/dpif-netdev-avx512.c
index fff469e10..29b4b856a 100644
--- a/lib/dpif-netdev-avx512.c
+++ b/lib/dpif-netdev-avx512.c
@@ -35,6 +35,8 @@
 
 #include "immintrin.h"
 
+#include "flow_avx512.h"
+
 /* Structure to contain per-packet metadata that must be attributed to the
  * dp netdev flow. This is unfortunate to have to track per packet, however
  * it's a bit awkward to maintain them in a performant way. This structure
@@ -68,15 +70,24 @@ dp_netdev_input_outer_avx512_probe(void)
 return 0;
 }
 
-int32_t
-dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread *pmd,
- struct dp_packet_batch *packets,
- odp_port_t in_port)
+/* Specialize DPIF based on enabled options, eg for DPCLS only. */
+static inline ALWAYS_INLINE int32_t
+dp_netdev_input_outer_avx512_impl(struct dp_netdev_pmd_thread *pmd,
+  struct dp_packet_batch *packets,
+  odp_port_t in_port,
+  uint32_t dpcls_only)
 {
-/* Allocate DPIF userdata. */
 if (OVS_UNLIKELY(!pmd->netdev_input_func_userdata)) {
 pmd->netdev_input_func_userdata =
 xmalloc_pagealign(sizeof(struct dpif_userdata));
+/* TODO: Enable MFEX selector/autovalidator as done for DPCLS.
+ *   This code shows the POC value, not final upstream code.
+ *   As the code uses AVX512-VBMI, check for ISA at runtime.
+ */
+int avx512vbmi = dpdk_get_cpu_has_isa("x86_64", "avx512vbmi");
+if (avx512vbmi) {
+pmd->mfex_func = mfex_avx512_ipv4_udp;
+}
 }
 
 struct dpif_userdata *ud = pmd->netdev_input_func_userdata;
@@ -84,6 +95,14 @@ dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread 
*pmd,
 struct netdev_flow_key **key_ptrs = ud->key_ptrs;
 struct pkt_flow_meta *pkt_meta = ud->pkt_meta;
 
+/* TODO: make runtime command to allow users to disable/enable.
+ * Not all users need TCP-flags or bytes per rule, and it costs performance
+ * to always calculate it. Enabling this costs ~6 cycles/pkt. It will be
+ * enabled by default for consistency & backwards compat, but disabling
+ * could be investigated by users if they so desire.
+ */
+uint32_t do_pkt_meta = 1;
+
 /* Stores the computed output: a rule pointer for each packet */
 /* The AVX512 DPIF implementation handles rules in a way that is optimized
  * for reducing data-movement between HWOL/EMC/SMC and DPCLS. This is
@@ -92,7 +111,8 @@ dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread 
*pmd,
  * array. Later the two arrays are merged by AVX-512 expand instructions.
  */
 struct dpcls_rule *rules[NETDEV_MAX_BURST];
-struct dpcls_rule *dpcls_rules[NETDEV_MAX_BURST];
+struct dpcls_rule *dpcls_rules_impl[NETDEV_MAX_BURST];
+struct dpcls_rule **dpcls_rules = dpcls_rules_impl;
 uint32_t dpcls_key_idx = 0;
 
 for (uint32_t i = 0; i < NETDEV_MAX_BURST; i += 8) {
@@ -100,12 +120,8 @@ dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread 
*pmd,
 _mm512_storeu_si512(&dpcls_rules[i], _mm512_setzero_si512());
 }
 
-/* Prefetch each packet's metadata */
-const size_t batch_size = d

[ovs-dev] [PATCH v9 12/16] dpdk: Cache result of CPU ISA checks.

2021-02-12 Thread Harry van Haaren
As a small optimization, this patch caches the result of a CPU ISA
check from DPDK. Particularly in the case of running the DPCLS
autovalidator (which repeatedly probes subtables) this reduces
the amount of CPU ISA lookups from the DPDK level.

By caching them at the OVS/dpdk.c level, the ISA checks remain
runtime for the CPU where they are executed, but subsequent checks
for the same ISA feature become much cheaper.

Signed-off-by: Harry van Haaren 
Co-authored-by: Cian Ferriter 
Signed-off-by: Cian Ferriter 

---

v8: Add NEWS entry.
---
 NEWS   |  1 +
 lib/dpdk.c | 28 
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index a5bb16da2..0a093e582 100644
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,7 @@ v2.15.0 - xx xxx 
- DPDK:
  * Removed support for vhost-user dequeue zero-copy.
  * Add support for DPDK 20.11.
+ * Cache results for CPU ISA checks, reduces overhead on repeated lookups.
- Userspace datapath:
  * Add the 'pmd' option to "ovs-appctl dpctl/dump-flows", which
restricts a flow dump to a single PMD thread if set.
diff --git a/lib/dpdk.c b/lib/dpdk.c
index 319540394..c883a4b8b 100644
--- a/lib/dpdk.c
+++ b/lib/dpdk.c
@@ -614,13 +614,33 @@ print_dpdk_version(void)
 puts(rte_version());
 }
 
+/* Avoid calling rte_cpu_get_flag_enabled() excessively, by caching the
+ * result of the call for each CPU flag in a static variable. To avoid
+ * allocating large numbers of static variables, use a uint8 as a bitfield.
+ * Note the macro must only return if the ISA check is done and available.
+ */
+#define ISA_CHECK_DONE_BIT (1 << 0)
+#define ISA_AVAILABLE_BIT  (1 << 1)
+
 #define CHECK_CPU_FEATURE(feature, name_str, RTE_CPUFLAG)   \
 do {\
 if (strncmp(feature, name_str, strlen(name_str)) == 0) {\
-int has_isa = rte_cpu_get_flag_enabled(RTE_CPUFLAG);\
-VLOG_DBG("CPU flag %s, available %s\n", name_str,   \
-  has_isa ? "yes" : "no");  \
-return true;\
+static uint8_t isa_check_##RTE_CPUFLAG; \
+int check = isa_check_##RTE_CPUFLAG & ISA_CHECK_DONE_BIT;   \
+if (OVS_UNLIKELY(!check)) { \
+int has_isa = rte_cpu_get_flag_enabled(RTE_CPUFLAG);\
+VLOG_DBG("CPU flag %s, available %s\n", \
+ name_str, has_isa ? "yes" : "no"); \
+isa_check_##RTE_CPUFLAG = ISA_CHECK_DONE_BIT;   \
+if (has_isa) {  \
+isa_check_##RTE_CPUFLAG |= ISA_AVAILABLE_BIT;   \
+}   \
+}   \
+if (isa_check_##RTE_CPUFLAG & ISA_AVAILABLE_BIT) {  \
+return true;\
+} else {\
+return false;   \
+}   \
 }   \
 } while (0)
 
-- 
2.25.1

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


[ovs-dev] [PATCH v9 05/16] dpif-avx512: Add HWOL support to avx512 dpif.

2021-02-12 Thread Harry van Haaren
Partial hardware offload is implemented in a very similar way to the
scalar dpif.

Signed-off-by: Harry van Haaren 
---
 lib/dpif-netdev-avx512.c | 28 +---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/lib/dpif-netdev-avx512.c b/lib/dpif-netdev-avx512.c
index 10228aeb0..caba1fa1c 100644
--- a/lib/dpif-netdev-avx512.c
+++ b/lib/dpif-netdev-avx512.c
@@ -27,6 +27,7 @@
 #include "dpif-netdev-private-dpcls.h"
 #include "dpif-netdev-private-flow.h"
 #include "dpif-netdev-private-thread.h"
+#include "dpif-netdev-private-hwol.h"
 
 #include "dp-packet.h"
 #include "netdev.h"
@@ -111,9 +112,32 @@ dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread 
*pmd,
 uint32_t i = __builtin_ctz(iter);
 iter = _blsr_u64(iter);
 
-/* Initialize packet md and do miniflow extract */
+/* Get packet pointer from bitmask and packet md */
 struct dp_packet *packet = packets->packets[i];
 pkt_metadata_init(&packet->md, in_port);
+
+struct dp_netdev_flow *f = NULL;
+
+/* Check for partial hardware offload mark */
+uint32_t mark;
+if (dp_packet_has_flow_mark(packet, &mark)) {
+f = mark_to_flow_find(pmd, mark);
+if (f) {
+rules[i] = &f->cr;
+
+/* This is nasty - instead of using the HWOL provided flow,
+ * parse the packet data anyway to find the location of the TCP
+ * header to extract the TCP flags for the rule.
+ */
+pkt_meta[i].tcp_flags = parse_tcp_flags(packet);
+
+pkt_meta[i].bytes = dp_packet_size(packet);
+hwol_emc_smc_hitmask |= (1 << i);
+continue;
+}
+}
+
+/* Do miniflow extract into keys */
 struct netdev_flow_key *key = &keys[i];
 miniflow_extract(packet, &key->mf);
 
@@ -124,8 +148,6 @@ dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread 
*pmd,
 key->len = netdev_flow_key_size(miniflow_n_values(&key->mf));
 key->hash = dpif_netdev_packet_get_rss_hash_orig_pkt(packet, &key->mf);
 
-struct dp_netdev_flow *f = NULL;
-
 if (emc_enabled) {
 f = emc_lookup(&cache->emc_cache, key);
 
-- 
2.25.1

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


[ovs-dev] [PATCH v9 15/16] netdev: Optimize netdev_send_prepare_batch

2021-02-12 Thread Harry van Haaren
Optimize for the best case here where all packets will be compatible
with 'netdev_flags'.

Signed-off-by: Harry van Haaren 
Co-authored-by: Cian Ferriter 
Signed-off-by: Cian Ferriter 

---

v9: rebase 2
---
 NEWS |  2 ++
 lib/netdev.c | 31 ++-
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/NEWS b/NEWS
index 2ffc155f9..cbdcf53a1 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ Post-v2.15.0
CPU supports it. This enhances performance by using the native vpopcount
instructions, instead of the emulated version of vpopcount.
  * Optimize dp_netdev_output by enhancing compiler optimization potential.
+ * Optimize netdev sending by assuming the happy case, and using fallback
+   for if the netdev doesnt meet the required HWOL needs of a packet.
 
 v2.15.0 - xx xxx 
 -
diff --git a/lib/netdev.c b/lib/netdev.c
index 91e91955c..29a5f1aa9 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -837,20 +837,33 @@ static void
 netdev_send_prepare_batch(const struct netdev *netdev,
   struct dp_packet_batch *batch)
 {
-struct dp_packet *packet;
-size_t i, size = dp_packet_batch_size(batch);
+struct dp_packet *p;
+uint32_t i, size = dp_packet_batch_size(batch);
+char *err_msg = NULL;
 
-DP_PACKET_BATCH_REFILL_FOR_EACH (i, size, packet, batch) {
-char *errormsg = NULL;
+for (i = 0; i < size; i++) {
+p = batch->packets[i];
+int pkt_ok = netdev_send_prepare_packet(netdev->ol_flags, p, &err_msg);
 
-if (netdev_send_prepare_packet(netdev->ol_flags, packet, &errormsg)) {
-dp_packet_batch_refill(batch, packet, i);
+if (OVS_UNLIKELY(!pkt_ok)) {
+goto refill_loop;
+}
+}
+
+return;
+
+refill_loop:
+/* Loop through packets from the start of the batch again. This is the
+ * exceptional case where packets aren't compatible with 'netdev_flags'. */
+DP_PACKET_BATCH_REFILL_FOR_EACH (i, size, p, batch) {
+if (netdev_send_prepare_packet(netdev->ol_flags, p, &err_msg)) {
+dp_packet_batch_refill(batch, p, i);
 } else {
-dp_packet_delete(packet);
+dp_packet_delete(p);
 COVERAGE_INC(netdev_send_prepare_drops);
 VLOG_WARN_RL(&rl, "%s: Packet dropped: %s",
- netdev_get_name(netdev), errormsg);
-free(errormsg);
+ netdev_get_name(netdev), err_msg);
+free(err_msg);
 }
 }
 }
-- 
2.25.1

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


[ovs-dev] [PATCH v9 14/16] dpif-netdev: Optimize dp output action

2021-02-12 Thread Harry van Haaren
This commit optimizes the output action, by enabling the compiler to
optimize the code better through reducing code complexity.

The core concept of this optimization is that the array-length checks
have already been performed above the copying code, so can be removed.
Removing of the per-packet length checks allows the compiler to auto-vectorize
the stores using SIMD registers.

Signed-off-by: Harry van Haaren 

---

v8: Add NEWS entry.
---
 NEWS  |  1 +
 lib/dpif-netdev.c | 23 ++-
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index 5f1e3b5e0..2ffc155f9 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Post-v2.15.0
  * Enable the AVX512 DPCLS implementation to use VPOPCNT instruction if the
CPU supports it. This enhances performance by using the native vpopcount
instructions, instead of the emulated version of vpopcount.
+ * Optimize dp_netdev_output by enhancing compiler optimization potential.
 
 v2.15.0 - xx xxx 
 -
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 5e83755d7..b2cf1bd46 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -7254,12 +7254,25 @@ dp_execute_output_action(struct dp_netdev_pmd_thread 
*pmd,
 pmd->n_output_batches++;
 }
 
-struct dp_packet *packet;
-DP_PACKET_BATCH_FOR_EACH (i, packet, packets_) {
-p->output_pkts_rxqs[dp_packet_batch_size(&p->output_pkts)] =
-pmd->ctx.last_rxq;
-dp_packet_batch_add(&p->output_pkts, packet);
+/* The above checks ensure that there is enough space in the output batch.
+ * Using dp_packet_batch_add() has a branch to check if the batch is full.
+ * This branch reduces the compiler's ability to optimize efficiently. The
+ * below code implements packet movement between batches without checks,
+ * with the required semantics of output batch perhaps containing packets.
+ */
+int batch_size = dp_packet_batch_size(packets_);
+int out_batch_idx = dp_packet_batch_size(&p->output_pkts);
+struct dp_netdev_rxq *rxq = pmd->ctx.last_rxq;
+struct dp_packet_batch *output_batch = &p->output_pkts;
+
+for (int i = 0; i < batch_size; i++) {
+struct dp_packet *packet = packets_->packets[i];
+p->output_pkts_rxqs[out_batch_idx] = rxq;
+output_batch->packets[out_batch_idx] = packet;
+out_batch_idx++;
 }
+output_batch->count += batch_size;
+
 return true;
 }
 
-- 
2.25.1

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


[ovs-dev] [PATCH v9 11/16] dpif-netdev/dpcls: specialize more subtable signatures.

2021-02-12 Thread Harry van Haaren
This commit adds more subtables to be specialized. The traffic
pattern here being matched is VXLAN traffic subtables, which commonly
have (5,3), (9,1) and (9,4) subtable fingerprints.

Signed-off-by: Harry van Haaren 

---

v8: Add NEWS entry.
---
 NEWS   | 2 ++
 lib/dpif-netdev-lookup-avx512-gather.c | 6 ++
 lib/dpif-netdev-lookup-generic.c   | 6 ++
 3 files changed, 14 insertions(+)

diff --git a/NEWS b/NEWS
index d3b9221ed..a5bb16da2 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ Post-v2.15.0
packets. It supports partial HWOL, EMC, SMC and DPCLS lookups.
  * Add commands to get and set the dpif implementations.
  * Enable AVX512 optimized DPCLS to search subtables with larger miniflows.
+ * Add more specialized DPCLS subtables to cover common rules, enhancing
+   the lookup performance.
 
 v2.15.0 - xx xxx 
 -
diff --git a/lib/dpif-netdev-lookup-avx512-gather.c 
b/lib/dpif-netdev-lookup-avx512-gather.c
index 1f27c0536..3a684fadf 100644
--- a/lib/dpif-netdev-lookup-avx512-gather.c
+++ b/lib/dpif-netdev-lookup-avx512-gather.c
@@ -299,6 +299,9 @@ avx512_lookup_impl(struct dpcls_subtable *subtable,
 return avx512_lookup_impl(subtable, keys_map, keys, rules, U0, U1);   \
 } \
 
+DECLARE_OPTIMIZED_LOOKUP_FUNCTION(9, 4)
+DECLARE_OPTIMIZED_LOOKUP_FUNCTION(9, 1)
+DECLARE_OPTIMIZED_LOOKUP_FUNCTION(5, 3)
 DECLARE_OPTIMIZED_LOOKUP_FUNCTION(5, 1)
 DECLARE_OPTIMIZED_LOOKUP_FUNCTION(4, 1)
 DECLARE_OPTIMIZED_LOOKUP_FUNCTION(4, 0)
@@ -331,6 +334,9 @@ dpcls_subtable_avx512_gather_probe(uint32_t u0_bits, 
uint32_t u1_bits)
 return NULL;
 }
 
+CHECK_LOOKUP_FUNCTION(9, 4);
+CHECK_LOOKUP_FUNCTION(9, 1);
+CHECK_LOOKUP_FUNCTION(5, 3);
 CHECK_LOOKUP_FUNCTION(5, 1);
 CHECK_LOOKUP_FUNCTION(4, 1);
 CHECK_LOOKUP_FUNCTION(4, 0);
diff --git a/lib/dpif-netdev-lookup-generic.c b/lib/dpif-netdev-lookup-generic.c
index e3b6be4b6..6c74ac3a1 100644
--- a/lib/dpif-netdev-lookup-generic.c
+++ b/lib/dpif-netdev-lookup-generic.c
@@ -282,6 +282,9 @@ dpcls_subtable_lookup_generic(struct dpcls_subtable 
*subtable,
 return lookup_generic_impl(subtable, keys_map, keys, rules, U0, U1);  \
 } \
 
+DECLARE_OPTIMIZED_LOOKUP_FUNCTION(9, 4)
+DECLARE_OPTIMIZED_LOOKUP_FUNCTION(9, 1)
+DECLARE_OPTIMIZED_LOOKUP_FUNCTION(5, 3)
 DECLARE_OPTIMIZED_LOOKUP_FUNCTION(5, 1)
 DECLARE_OPTIMIZED_LOOKUP_FUNCTION(4, 1)
 DECLARE_OPTIMIZED_LOOKUP_FUNCTION(4, 0)
@@ -303,6 +306,9 @@ dpcls_subtable_generic_probe(uint32_t u0_bits, uint32_t 
u1_bits)
 {
 dpcls_subtable_lookup_func f = NULL;
 
+CHECK_LOOKUP_FUNCTION(9, 4);
+CHECK_LOOKUP_FUNCTION(9, 1);
+CHECK_LOOKUP_FUNCTION(5, 3);
 CHECK_LOOKUP_FUNCTION(5, 1);
 CHECK_LOOKUP_FUNCTION(4, 1);
 CHECK_LOOKUP_FUNCTION(4, 0);
-- 
2.25.1

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


[ovs-dev] [PATCH v9 13/16] dpcls-avx512: enabling avx512 vector popcount instruction.

2021-02-12 Thread Harry van Haaren
This commit enables the AVX512-VPOPCNTDQ Vector Popcount
instruction. This instruction is not available on every CPU
that supports the AVX512-F Foundation ISA, hence it is enabled
only when the additional VPOPCNTDQ ISA check is passed.

The vector popcount instruction is used instead of the AVX512
popcount emulation code present in the avx512 optimized DPCLS today.
It provides higher performance in the SIMD miniflow processing
as that requires the popcount to calculate the miniflow block indexes.

Signed-off-by: Harry van Haaren 

---

v8: Add NEWS entry.
---
 NEWS   |  3 +
 lib/dpdk.c |  1 +
 lib/dpif-netdev-lookup-avx512-gather.c | 84 --
 3 files changed, 70 insertions(+), 18 deletions(-)

diff --git a/NEWS b/NEWS
index 0a093e582..5f1e3b5e0 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ Post-v2.15.0
  * Enable AVX512 optimized DPCLS to search subtables with larger miniflows.
  * Add more specialized DPCLS subtables to cover common rules, enhancing
the lookup performance.
+ * Enable the AVX512 DPCLS implementation to use VPOPCNT instruction if the
+   CPU supports it. This enhances performance by using the native vpopcount
+   instructions, instead of the emulated version of vpopcount.
 
 v2.15.0 - xx xxx 
 -
diff --git a/lib/dpdk.c b/lib/dpdk.c
index c883a4b8b..a9494a40f 100644
--- a/lib/dpdk.c
+++ b/lib/dpdk.c
@@ -655,6 +655,7 @@ dpdk_get_cpu_has_isa(const char *arch, const char *feature)
 #if __x86_64__
 /* CPU flags only defined for the architecture that support it. */
 CHECK_CPU_FEATURE(feature, "avx512f", RTE_CPUFLAG_AVX512F);
+CHECK_CPU_FEATURE(feature, "avx512vpopcntdq", RTE_CPUFLAG_AVX512VPOPCNTDQ);
 CHECK_CPU_FEATURE(feature, "bmi2", RTE_CPUFLAG_BMI2);
 #endif
 
diff --git a/lib/dpif-netdev-lookup-avx512-gather.c 
b/lib/dpif-netdev-lookup-avx512-gather.c
index 3a684fadf..9a3273dc6 100644
--- a/lib/dpif-netdev-lookup-avx512-gather.c
+++ b/lib/dpif-netdev-lookup-avx512-gather.c
@@ -53,6 +53,15 @@
 
 VLOG_DEFINE_THIS_MODULE(dpif_lookup_avx512_gather);
 
+
+/* Wrapper function required to enable ISA. */
+static inline __m512i
+__attribute__((__target__("avx512vpopcntdq")))
+_mm512_popcnt_epi64_wrapper(__m512i v_in)
+{
+return _mm512_popcnt_epi64(v_in);
+}
+
 static inline __m512i
 _mm512_popcnt_epi64_manual(__m512i v_in)
 {
@@ -126,7 +135,8 @@ avx512_blocks_gather(__m512i v_u0, /* reg of u64 of all u0 
bits */
  __mmask64 u1_bcast_msk,  /* mask of u1 lanes */
  const uint64_t pkt_mf_u0_pop, /* num bits in u0 of pkt */
  __mmask64 zero_mask, /* maskz if pkt not have mf bit */
- __mmask64 u64_lanes_mask) /* total lane count to use */
+ __mmask64 u64_lanes_mask, /* total lane count to use */
+ const uint32_t use_vpop)  /* use AVX512 vpopcntdq */
 {
 /* Suggest to compiler to load tbl blocks ahead of gather() */
 __m512i v_tbl_blocks = _mm512_maskz_loadu_epi64(u64_lanes_mask,
@@ -140,8 +150,15 @@ avx512_blocks_gather(__m512i v_u0, /* reg of u64 of all u0 
bits */
   tbl_mf_masks);
 __m512i v_masks = _mm512_and_si512(v_pkt_bits, v_tbl_masks);
 
-/* Manual AVX512 popcount for u64 lanes. */
-__m512i v_popcnts = _mm512_popcnt_epi64_manual(v_masks);
+/* Calculate AVX512 popcount for u64 lanes using the native instruction
+ * if available, or using emulation if not available.
+ */
+__m512i v_popcnts;
+if (use_vpop) {
+v_popcnts = _mm512_popcnt_epi64_wrapper(v_masks);
+} else {
+v_popcnts = _mm512_popcnt_epi64_manual(v_masks);
+}
 
 /* Add popcounts and offset for u1 bits. */
 __m512i v_idx_u0_offset = _mm512_maskz_set1_epi64(u1_bcast_msk,
@@ -166,7 +183,8 @@ avx512_lookup_impl(struct dpcls_subtable *subtable,
const struct netdev_flow_key *keys[],
struct dpcls_rule **rules,
const uint32_t bit_count_u0,
-   const uint32_t bit_count_u1)
+   const uint32_t bit_count_u1,
+   const uint32_t use_vpop)
 {
 OVS_ALIGNED_VAR(CACHE_LINE_SIZE)uint64_t block_cache[BLOCKS_CACHE_SIZE];
 uint32_t hashes[NETDEV_MAX_BURST];
@@ -218,7 +236,8 @@ avx512_lookup_impl(struct dpcls_subtable *subtable,
 u1_bcast_mask,
 pkt_mf_u0_pop,
 zero_mask,
-bit_count_total_mask);
+bit_count_total_mask,
+use_vpop);
 _mm512_storeu_si512(&block_cache[i * MF_BLOCKS_PER_PACKET], v_blocks)

[ovs-dev] [PATCH v9 10/16] dpif-netdev/dpcls-avx512: enable 16 block processing.

2021-02-12 Thread Harry van Haaren
This commit implements larger subtable searches in avx512. A limitation
of the previous implementation was that up to 8 blocks of miniflow
data could be matched on (so a subtable with 8 blocks was handled
in avx, but 9 blocks or more would fall back to scalar/generic).
This limitation is removed in this patch, where up to 16 blocks
of subtable can be matched on.

>From an implementation perspective, the key to enabling 16 blocks
over 8 blocks was to do bitmask calculation up front, and then use
the pre-calculated bitmasks for 2x passes of the "blocks gather"
routine. The bitmasks need to be shifted for k-mask usage in the
upper (8-15) block range, but it is relatively trivial. This also
helps in case expanding to 24 blocks is desired in future.

The implementation of the 2nd iteration to handle > 8 blocks is
behind a conditional branch which checks the total number of bits.
This helps the specialized versions of the function that have a
miniflow fingerprint of less-than-or-equal 8 blocks, as the code
can be statically stripped out of those functions. Specialized
functions that do require more than 8 blocks will have the branch
removed and unconditionally execute the 2nd blocks gather routine.

Lastly, the _any() flavour will have the conditional branch, and
the branch predictor may mispredict a bit, but per burst will
likely get most packets correct (particularly towards the middle
and end of a burst).

The code has been run with unit tests under autovalidation and
passes all cases, and unit test coverage has been checked to
ensure the 16 block code paths are executing.

Signed-off-by: Harry van Haaren 

---

v9: Fixup post 2.15 rebase on NEWS
v8: Add NEWS entry
---
 NEWS   |   1 +
 lib/dpif-netdev-lookup-avx512-gather.c | 203 ++---
 2 files changed, 147 insertions(+), 57 deletions(-)

diff --git a/NEWS b/NEWS
index a03e9d7be..d3b9221ed 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Post-v2.15.0
  * Add avx512 implementation of dpif which can process non recirculated
packets. It supports partial HWOL, EMC, SMC and DPCLS lookups.
  * Add commands to get and set the dpif implementations.
+ * Enable AVX512 optimized DPCLS to search subtables with larger miniflows.
 
 v2.15.0 - xx xxx 
 -
diff --git a/lib/dpif-netdev-lookup-avx512-gather.c 
b/lib/dpif-netdev-lookup-avx512-gather.c
index 8fc1cdfa5..1f27c0536 100644
--- a/lib/dpif-netdev-lookup-avx512-gather.c
+++ b/lib/dpif-netdev-lookup-avx512-gather.c
@@ -34,7 +34,21 @@
  * AVX512 code at a time.
  */
 #define NUM_U64_IN_ZMM_REG (8)
-#define BLOCKS_CACHE_SIZE (NETDEV_MAX_BURST * NUM_U64_IN_ZMM_REG)
+
+/* This implementation of AVX512 gather allows up to 16 blocks of MF data to be
+ * present in the blocks_cache, hence the multiply by 2 in the blocks count.
+ */
+#define MF_BLOCKS_PER_PACKET (NUM_U64_IN_ZMM_REG * 2)
+
+/* Blocks cache size is the maximum number of miniflow blocks that this
+ * implementation of lookup can handle.
+ */
+#define BLOCKS_CACHE_SIZE (NETDEV_MAX_BURST * MF_BLOCKS_PER_PACKET)
+
+/* The gather instruction can handle a scale for the size of the items to
+ * gather. For uint64_t data, this scale is 8.
+ */
+#define GATHER_SCALE_8 (8)
 
 
 VLOG_DEFINE_THIS_MODULE(dpif_lookup_avx512_gather);
@@ -69,22 +83,83 @@ netdev_rule_matches_key(const struct dpcls_rule *rule,
 {
 const uint64_t *keyp = miniflow_get_values(&rule->flow.mf);
 const uint64_t *maskp = miniflow_get_values(&rule->mask->mf);
-const uint32_t lane_mask = (1 << mf_bits_total) - 1;
+const uint32_t lane_mask = (1ULL << mf_bits_total) - 1;
 
 /* Always load a full cache line from blocks_cache. Other loads must be
  * trimmed to the amount of data required for mf_bits_total blocks.
  */
-__m512i v_blocks = _mm512_loadu_si512(&block_cache[0]);
-__m512i v_mask   = _mm512_maskz_loadu_epi64(lane_mask, &maskp[0]);
-__m512i v_key= _mm512_maskz_loadu_epi64(lane_mask, &keyp[0]);
+uint32_t res_mask;
+
+{
+__m512i v_blocks = _mm512_loadu_si512(&block_cache[0]);
+__m512i v_mask   = _mm512_maskz_loadu_epi64(lane_mask, &maskp[0]);
+__m512i v_key= _mm512_maskz_loadu_epi64(lane_mask, &keyp[0]);
+__m512i v_data = _mm512_and_si512(v_blocks, v_mask);
+res_mask = _mm512_mask_cmpeq_epi64_mask(lane_mask, v_data, v_key);
+}
 
-__m512i v_data = _mm512_and_si512(v_blocks, v_mask);
-uint32_t res_mask = _mm512_mask_cmpeq_epi64_mask(lane_mask, v_data, v_key);
+if (mf_bits_total > 8) {
+uint32_t lane_mask_gt8 = lane_mask >> 8;
+__m512i v_blocks = _mm512_loadu_si512(&block_cache[8]);
+__m512i v_mask   = _mm512_maskz_loadu_epi64(lane_mask_gt8, &maskp[8]);
+__m512i v_key= _mm512_maskz_loadu_epi64(lane_mask_gt8, &keyp[8]);
+__m512i v_data = _mm512_and_si512(v_blocks, v_mask);
+uint32_t c = _mm512_mask_cmpeq_epi64_mask(lane_mask_gt8, v_data,
+ 

[ovs-dev] [PATCH v9 08/16] docs/dpdk/bridge: Add dpif performance section.

2021-02-12 Thread Harry van Haaren
From: Cian Ferriter 

This section details how two new commands can be used to list and select
the different dpif implementations. It also details how a non default
dpif implementation can be tested with the OVS unit test suite.

Add NEWS updates for the dpif-netdev.c refactor and the new dpif
implementations/commands.

Signed-off-by: Cian Ferriter 

---

v8:
- Merge NEWS file items into one Userspace Datapath: heading
---
 Documentation/topics/dpdk/bridge.rst | 37 
 NEWS |  6 -
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/Documentation/topics/dpdk/bridge.rst 
b/Documentation/topics/dpdk/bridge.rst
index 526d5c959..ca90d7bdb 100644
--- a/Documentation/topics/dpdk/bridge.rst
+++ b/Documentation/topics/dpdk/bridge.rst
@@ -214,3 +214,40 @@ implementation ::
 
 Compile OVS in debug mode to have `ovs_assert` statements error out if
 there is a mis-match in the DPCLS lookup implementation.
+
+Datapath Interface Performance
+--
+
+The datapath interface (DPIF) or dp_netdev_input() is responsible for taking
+packets through the major components of the userspace datapath; such as
+miniflow_extract, EMC, SMC and DPCLS lookups, and a lot of the performance
+stats associated with the datapath.
+
+Just like with the SIMD DPCLS work above, SIMD can be applied to the DPIF to
+improve performance.
+
+OVS provides multiple implementations of the DPIF. These can be listed with the
+following command ::
+
+$ ovs-appctl dpif-netdev/dpif-get
+Available DPIF implementations:
+  dpif_scalar
+  dpif_avx512
+
+By default, dpif_scalar is used. The DPIF implementation can be selected by
+name ::
+
+$ ovs-appctl dpif-netdev/dpif-set dpif_avx512
+DPIF implementation set to dpif_avx512.
+
+$ ovs-appctl dpif-netdev/dpif-set dpif_scalar
+DPIF implementation set to dpif_scalar.
+
+Running Unit Tests with AVX512 DPIF
+~~~
+
+Since the AVX512 DPIF is disabled by default, a compile time option is
+available in order to test it with the OVS unit test suite. When building with
+a CPU that supports AVX512, use the following configure option ::
+
+$ ./configure --enable-dpif-default-avx512
diff --git a/NEWS b/NEWS
index a7bffce97..a03e9d7be 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,11 @@ Post-v2.15.0
 -
- In ovs-vsctl and vtep-ctl, the "find" command now accept new
  operators {in} and {not-in}.
-
+   - Userspace Datapath:
+ * Refactor lib/dpif-netdev.c to multiple header files.
+ * Add avx512 implementation of dpif which can process non recirculated
+   packets. It supports partial HWOL, EMC, SMC and DPCLS lookups.
+ * Add commands to get and set the dpif implementations.
 
 v2.15.0 - xx xxx 
 -
-- 
2.25.1

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


[ovs-dev] [PATCH v9 07/16] dpif-netdev: Add command to get dpif implementations.

2021-02-12 Thread Harry van Haaren
This commit adds a new command to retrieve the list of available
DPIF implementations. This can be used by to check what implementations
of the DPIF are available in any given OVS binary.

Usage:
 $ ovs-appctl dpif-netdev/dpif-get

Signed-off-by: Harry van Haaren 
---
 lib/dpif-netdev-private-dpif.c |  7 +++
 lib/dpif-netdev-private-dpif.h |  6 ++
 lib/dpif-netdev.c  | 24 
 3 files changed, 37 insertions(+)

diff --git a/lib/dpif-netdev-private-dpif.c b/lib/dpif-netdev-private-dpif.c
index 9e1f3b8f9..c5021fe9f 100644
--- a/lib/dpif-netdev-private-dpif.c
+++ b/lib/dpif-netdev-private-dpif.c
@@ -61,6 +61,13 @@ dp_netdev_impl_get_default(void)
 return func;
 }
 
+uint32_t
+dp_netdev_impl_get(const struct dpif_netdev_impl_info_t **out_impls)
+{
+ovs_assert(out_impls);
+*out_impls = dpif_impls;
+return ARRAY_SIZE(dpif_impls);
+}
 
 /* This function checks all available DPIF implementations, and selects the
  * returns the function pointer to the one requested by "name".
diff --git a/lib/dpif-netdev-private-dpif.h b/lib/dpif-netdev-private-dpif.h
index a09f90acc..99fbda943 100644
--- a/lib/dpif-netdev-private-dpif.h
+++ b/lib/dpif-netdev-private-dpif.h
@@ -47,6 +47,12 @@ struct dpif_netdev_impl_info_t {
 const char *name;
 };
 
+/* This function returns all available implementations to the caller. The
+ * quantity of implementations is returned by the int return value.
+ */
+uint32_t
+dp_netdev_impl_get(const struct dpif_netdev_impl_info_t **out_impls);
+
 /* This function checks all available DPIF implementations, and selects the
  * returns the function pointer to the one requested by "name".
  */
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 564d94a97..dff844f99 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -992,6 +992,27 @@ dpif_netdev_subtable_lookup_set(struct unixctl_conn *conn, 
int argc,
 ds_destroy(&reply);
 }
 
+static void
+dpif_netdev_impl_get(struct unixctl_conn *conn, int argc OVS_UNUSED,
+ const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+{
+const struct dpif_netdev_impl_info_t *dpif_impls;
+uint32_t count = dp_netdev_impl_get(&dpif_impls);
+if (count == 0) {
+unixctl_command_reply_error(conn, "error getting dpif names");
+return;
+}
+
+/* Add all dpif functions to reply string. */
+struct ds reply = DS_EMPTY_INITIALIZER;
+ds_put_cstr(&reply, "Available DPIF implementations:\n");
+for (uint32_t i = 0; i < count; i++) {
+ds_put_format(&reply, "  %s\n", dpif_impls[i].name);
+}
+unixctl_command_reply(conn, ds_cstr(&reply));
+ds_destroy(&reply);
+}
+
 static void
 dpif_netdev_impl_set(struct unixctl_conn *conn, int argc,
  const char *argv[], void *aux OVS_UNUSED)
@@ -1290,6 +1311,9 @@ dpif_netdev_init(void)
  "[dpif implementation name] [dp]",
  1, 2, dpif_netdev_impl_set,
  NULL);
+unixctl_command_register("dpif-netdev/dpif-get", "",
+ 0, 0, dpif_netdev_impl_get,
+ NULL);
 return 0;
 }
 
-- 
2.25.1

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


[ovs-dev] [PATCH v9 09/16] dpif-netdev/dpcls: Refactor function names to dpcls.

2021-02-12 Thread Harry van Haaren
This commit refactors the function names from netdev_*
namespace to the dpcls_* namespace, as they are only used
by dpcls code. With the name change, it becomes more obvious
that the functions belong to dpcls functionality, and in the
dpif-netdev-private-dpcls.h header file.

Signed-off-by: Harry van Haaren 
---
 lib/dpif-netdev-private-dpcls.h |  6 ++
 lib/dpif-netdev.c   | 21 ++---
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/lib/dpif-netdev-private-dpcls.h b/lib/dpif-netdev-private-dpcls.h
index 5bc579bba..e66cae3f4 100644
--- a/lib/dpif-netdev-private-dpcls.h
+++ b/lib/dpif-netdev-private-dpcls.h
@@ -97,10 +97,8 @@ struct dpcls_subtable {
 
 /* Generates a mask for each bit set in the subtable's miniflow. */
 void
-netdev_flow_key_gen_masks(const struct netdev_flow_key *tbl,
-  uint64_t *mf_masks,
-  const uint32_t mf_bits_u0,
-  const uint32_t mf_bits_u1);
+dpcls_flow_key_gen_masks(const struct netdev_flow_key *tbl, uint64_t *mf_masks,
+ const uint32_t mf_bits_u0, const uint32_t mf_bits_u1);
 
 /* Matches a dpcls rule against the incoming packet in 'target' */
 bool dpcls_rule_matches_key(const struct dpcls_rule *rule,
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index dff844f99..5e83755d7 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -8278,7 +8278,7 @@ dpcls_create_subtable(struct dpcls *cls, const struct 
netdev_flow_key *mask)
 subtable->mf_bits_set_unit0 = unit0;
 subtable->mf_bits_set_unit1 = unit1;
 subtable->mf_masks = xmalloc(sizeof(uint64_t) * (unit0 + unit1));
-netdev_flow_key_gen_masks(mask, subtable->mf_masks, unit0, unit1);
+dpcls_flow_key_gen_masks(mask, subtable->mf_masks, unit0, unit1);
 
 /* Get the preferred subtable search function for this (u0,u1) subtable.
  * The function is guaranteed to always return a valid implementation, and
@@ -8453,11 +8453,10 @@ dpcls_remove(struct dpcls *cls, struct dpcls_rule *rule)
 }
 }
 
-/* Inner loop for mask generation of a unit, see netdev_flow_key_gen_masks. */
+/* Inner loop for mask generation of a unit, see dpcls_flow_key_gen_masks. */
 static inline void
-netdev_flow_key_gen_mask_unit(uint64_t iter,
-  const uint64_t count,
-  uint64_t *mf_masks)
+dpcls_flow_key_gen_mask_unit(uint64_t iter, const uint64_t count,
+ uint64_t *mf_masks)
 {
 int i;
 for (i = 0; i < count; i++) {
@@ -8478,16 +8477,16 @@ netdev_flow_key_gen_mask_unit(uint64_t iter,
  * @param mf_bits_unit0 Number of bits set in unit0 of the miniflow
  */
 void
-netdev_flow_key_gen_masks(const struct netdev_flow_key *tbl,
-  uint64_t *mf_masks,
-  const uint32_t mf_bits_u0,
-  const uint32_t mf_bits_u1)
+dpcls_flow_key_gen_masks(const struct netdev_flow_key *tbl,
+ uint64_t *mf_masks,
+ const uint32_t mf_bits_u0,
+ const uint32_t mf_bits_u1)
 {
 uint64_t iter_u0 = tbl->mf.map.bits[0];
 uint64_t iter_u1 = tbl->mf.map.bits[1];
 
-netdev_flow_key_gen_mask_unit(iter_u0, mf_bits_u0, &mf_masks[0]);
-netdev_flow_key_gen_mask_unit(iter_u1, mf_bits_u1, &mf_masks[mf_bits_u0]);
+dpcls_flow_key_gen_mask_unit(iter_u0, mf_bits_u0, &mf_masks[0]);
+dpcls_flow_key_gen_mask_unit(iter_u1, mf_bits_u1, &mf_masks[mf_bits_u0]);
 }
 
 /* Returns true if 'target' satisfies 'key' in 'mask', that is, if each 1-bit
-- 
2.25.1

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


[ovs-dev] [PATCH v9 06/16] dpif-netdev: Add command to switch dpif implementation.

2021-02-12 Thread Harry van Haaren
This commit adds a new command to allow the user to switch
the active DPIF implementation at runtime. A probe function
is executed before switching the DPIF implementation, to ensure
the CPU is capable of running the ISA required. For example, the
below code will switch to the AVX512 enabled DPIF assuming
that the runtime CPU is capable of running AVX512 instructions:

 $ ovs-appctl dpif-netdev/dpif-set dpif_avx512

A new configuration flag is added to allow selection of the
default DPIF. This is useful for running the unit-tests against
the available DPIF implementations, without modifying each unit test.

The design of the testing & validation for ISA optimized DPIF
implementations is based around the work already upstream for DPCLS.
Note however that a DPCLS lookup has no state or side-effects, allowing
the auto-validator implementation to perform multiple lookups and
provide consistent statistic counters.

The DPIF component does have state, so running two implementations in
parallel and comparing output is not a valid testing method, as there
are changes in DPIF statistic counters (side effects). As a result, the
DPIF is tested directly against the unit-tests.

Signed-off-by: Harry van Haaren 
Co-authored-by: Cian Ferriter 
Signed-off-by: Cian Ferriter 
---
 acinclude.m4 | 15 ++
 configure.ac |  1 +
 lib/automake.mk  |  1 +
 lib/dpif-netdev-avx512.c | 14 +
 lib/dpif-netdev-private-dpif.c   | 92 
 lib/dpif-netdev-private-dpif.h   | 43 ++-
 lib/dpif-netdev-private-thread.h | 12 +
 lib/dpif-netdev.c| 86 +++--
 8 files changed, 248 insertions(+), 16 deletions(-)
 create mode 100644 lib/dpif-netdev-private-dpif.c

diff --git a/acinclude.m4 b/acinclude.m4
index 435685c93..c9b0d56d6 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -30,6 +30,21 @@ AC_DEFUN([OVS_CHECK_DPCLS_AUTOVALIDATOR], [
   fi
 ])
 
+dnl Set OVS DPIF default implementation at configure time for running the unit
+dnl tests on the whole codebase without modifying tests per DPIF impl
+AC_DEFUN([OVS_CHECK_DPIF_AVX512_DEFAULT], [
+  AC_ARG_ENABLE([dpif-default-avx512],
+[AC_HELP_STRING([--enable-dpif-default-avx512], [Enable DPIF 
AVX512 implementation as default.])],
+[dpifavx512=yes],[dpifavx512=no])
+  AC_MSG_CHECKING([whether DPIF AVX512 is default implementation])
+  if test "$dpifavx512" != yes; then
+AC_MSG_RESULT([no])
+  else
+OVS_CFLAGS="$OVS_CFLAGS -DDPIF_AVX512_DEFAULT"
+AC_MSG_RESULT([yes])
+  fi
+])
+
 dnl OVS_ENABLE_WERROR
 AC_DEFUN([OVS_ENABLE_WERROR],
   [AC_ARG_ENABLE(
diff --git a/configure.ac b/configure.ac
index c077034d4..e45685a6c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,6 +185,7 @@ OVS_ENABLE_WERROR
 OVS_ENABLE_SPARSE
 OVS_CTAGS_IDENTIFIERS
 OVS_CHECK_DPCLS_AUTOVALIDATOR
+OVS_CHECK_DPIF_AVX512_DEFAULT
 OVS_CHECK_BINUTILS_AVX512
 
 AC_ARG_VAR(KARCH, [Kernel Architecture String])
diff --git a/lib/automake.mk b/lib/automake.mk
index d945d935e..5e493ebaf 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -115,6 +115,7 @@ lib_libopenvswitch_la_SOURCES = \
lib/dpif-netdev.h \
lib/dpif-netdev-private-dfc.h \
lib/dpif-netdev-private-dpcls.h \
+   lib/dpif-netdev-private-dpif.c \
lib/dpif-netdev-private-dpif.h \
lib/dpif-netdev-private-flow.h \
lib/dpif-netdev-private-hwol.h \
diff --git a/lib/dpif-netdev-avx512.c b/lib/dpif-netdev-avx512.c
index caba1fa1c..fff469e10 100644
--- a/lib/dpif-netdev-avx512.c
+++ b/lib/dpif-netdev-avx512.c
@@ -19,6 +19,7 @@
 #if !defined(__CHECKER__)
 
 #include 
+#include 
 
 #include "dpif-netdev.h"
 #include "dpif-netdev-perf.h"
@@ -54,6 +55,19 @@ struct dpif_userdata {
 struct pkt_flow_meta pkt_meta[NETDEV_MAX_BURST];
 };
 
+int32_t
+dp_netdev_input_outer_avx512_probe(void)
+{
+int avx512f_available = dpdk_get_cpu_has_isa("x86_64", "avx512f");
+int bmi2_available = dpdk_get_cpu_has_isa("x86_64", "bmi2");
+
+if (!avx512f_available || !bmi2_available) {
+return -ENOTSUP;
+}
+
+return 0;
+}
+
 int32_t
 dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread *pmd,
  struct dp_packet_batch *packets,
diff --git a/lib/dpif-netdev-private-dpif.c b/lib/dpif-netdev-private-dpif.c
new file mode 100644
index 0..9e1f3b8f9
--- /dev/null
+++ b/lib/dpif-netdev-private-dpif.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2020 Intel Corporation.
+ *
+ * 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 expr

[ovs-dev] [PATCH v9 02/16] dpif-netdev: Split HWOL out to own header file.

2021-02-12 Thread Harry van Haaren
This commit moves the datapath lookup functions required for
hardware offload to a seperate file. This allows other DPIF
implementations to access the lookup functions, encouraging
code reuse.

Signed-off-by: Harry van Haaren 
---
 lib/automake.mk|  1 +
 lib/dpif-netdev-private-hwol.h | 63 ++
 lib/dpif-netdev.c  | 39 ++---
 3 files changed, 67 insertions(+), 36 deletions(-)
 create mode 100644 lib/dpif-netdev-private-hwol.h

diff --git a/lib/automake.mk b/lib/automake.mk
index 0e83145b5..9b3e06db6 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -114,6 +114,7 @@ lib_libopenvswitch_la_SOURCES = \
lib/dpif-netdev-private-dfc.h \
lib/dpif-netdev-private-dpcls.h \
lib/dpif-netdev-private-flow.h \
+   lib/dpif-netdev-private-hwol.h \
lib/dpif-netdev-private-thread.h \
lib/dpif-netdev-private.h \
lib/dpif-netdev-perf.c \
diff --git a/lib/dpif-netdev-private-hwol.h b/lib/dpif-netdev-private-hwol.h
new file mode 100644
index 0..447010ab8
--- /dev/null
+++ b/lib/dpif-netdev-private-hwol.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015 Nicira, Inc.
+ * Copyright (c) 2020 Intel Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef DPIF_NETDEV_PRIVATE_HWOL_H
+#define DPIF_NETDEV_PRIVATE_HWOL_H 1
+
+#include "dpif-netdev-private-flow.h"
+
+#define MAX_FLOW_MARK   (UINT32_MAX - 1)
+#define INVALID_FLOW_MARK   0
+/* Zero flow mark is used to indicate the HW to remove the mark. A packet
+ * marked with zero mark is received in SW without a mark at all, so it
+ * cannot be used as a valid mark.
+ */
+
+struct megaflow_to_mark_data {
+const struct cmap_node node;
+ovs_u128 mega_ufid;
+uint32_t mark;
+};
+
+struct flow_mark {
+struct cmap megaflow_to_mark;
+struct cmap mark_to_flow;
+struct id_pool *pool;
+};
+
+/* allocated in dpif-netdev.c */
+extern struct flow_mark flow_mark;
+
+static inline struct dp_netdev_flow *
+mark_to_flow_find(const struct dp_netdev_pmd_thread *pmd,
+  const uint32_t mark)
+{
+struct dp_netdev_flow *flow;
+
+CMAP_FOR_EACH_WITH_HASH (flow, mark_node, hash_int(mark, 0),
+ &flow_mark.mark_to_flow) {
+if (flow->mark == mark && flow->pmd_id == pmd->core_id &&
+flow->dead == false) {
+return flow;
+}
+}
+
+return NULL;
+}
+
+
+#endif /* dpif-netdev-private-hwol.h */
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 395a5c29d..840298f01 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -84,6 +84,8 @@
 #include "util.h"
 #include "uuid.h"
 
+#include "dpif-netdev-private-hwol.h"
+
 VLOG_DEFINE_THIS_MODULE(dpif_netdev);
 
 /* Auto Load Balancing Defaults */
@@ -1953,26 +1955,8 @@ dp_netdev_pmd_find_dpcls(struct dp_netdev_pmd_thread 
*pmd,
 return cls;
 }
 
-#define MAX_FLOW_MARK   (UINT32_MAX - 1)
-#define INVALID_FLOW_MARK   0
-/* Zero flow mark is used to indicate the HW to remove the mark. A packet
- * marked with zero mark is received in SW without a mark at all, so it
- * cannot be used as a valid mark.
- */
-
-struct megaflow_to_mark_data {
-const struct cmap_node node;
-ovs_u128 mega_ufid;
-uint32_t mark;
-};
-
-struct flow_mark {
-struct cmap megaflow_to_mark;
-struct cmap mark_to_flow;
-struct id_pool *pool;
-};
 
-static struct flow_mark flow_mark = {
+struct flow_mark flow_mark = {
 .megaflow_to_mark = CMAP_INITIALIZER,
 .mark_to_flow = CMAP_INITIALIZER,
 };
@@ -2141,23 +2125,6 @@ flow_mark_flush(struct dp_netdev_pmd_thread *pmd)
 }
 }
 
-static struct dp_netdev_flow *
-mark_to_flow_find(const struct dp_netdev_pmd_thread *pmd,
-  const uint32_t mark)
-{
-struct dp_netdev_flow *flow;
-
-CMAP_FOR_EACH_WITH_HASH (flow, mark_node, hash_int(mark, 0),
- &flow_mark.mark_to_flow) {
-if (flow->mark == mark && flow->pmd_id == pmd->core_id &&
-flow->dead == false) {
-return flow;
-}
-}
-
-return NULL;
-}
-
 static struct dp_flow_offload_item *
 dp_netdev_alloc_flow_offload(struct dp_netdev_pmd_thread *pmd,
  struct dp_netdev_flow *flow,
-- 
2.25.1

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


[ovs-dev] [PATCH v9 04/16] dpif-avx512: Add ISA implementation of dpif.

2021-02-12 Thread Harry van Haaren
This commit adds the AVX512 implementation of DPIF functionality,
specifically the dp_netdev_input_outer_avx512 function. This function
only handles outer (no re-circulations), and is optimized to use the
AVX512 ISA for packet batching and other DPIF work.

Sparse is not able to handle the AVX512 intrinsics, causing compile
time failures, so it is disabled for this file.

Signed-off-by: Harry van Haaren 
Co-authored-by: Cian Ferriter 
Signed-off-by: Cian Ferriter 

---

v8:
- Fixup AVX512 mask to uint32_t conversion compilation warning.
---
 lib/automake.mk  |   5 +-
 lib/dpif-netdev-avx512.c | 264 +++
 lib/dpif-netdev-private-dfc.h|   8 +
 lib/dpif-netdev-private-dpif.h   |  32 
 lib/dpif-netdev-private-thread.h |  11 +-
 lib/dpif-netdev-private.h|  25 +++
 lib/dpif-netdev.c|  70 ++--
 7 files changed, 399 insertions(+), 16 deletions(-)
 create mode 100644 lib/dpif-netdev-avx512.c
 create mode 100644 lib/dpif-netdev-private-dpif.h

diff --git a/lib/automake.mk b/lib/automake.mk
index 9b3e06db6..d945d935e 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -33,11 +33,13 @@ lib_libopenvswitchavx512_la_CFLAGS = \
-mavx512f \
-mavx512bw \
-mavx512dq \
+   -mbmi \
-mbmi2 \
-fPIC \
$(AM_CFLAGS)
 lib_libopenvswitchavx512_la_SOURCES = \
-   lib/dpif-netdev-lookup-avx512-gather.c
+   lib/dpif-netdev-lookup-avx512-gather.c \
+   lib/dpif-netdev-avx512.c
 lib_libopenvswitchavx512_la_LDFLAGS = \
-static
 endif
@@ -113,6 +115,7 @@ lib_libopenvswitch_la_SOURCES = \
lib/dpif-netdev.h \
lib/dpif-netdev-private-dfc.h \
lib/dpif-netdev-private-dpcls.h \
+   lib/dpif-netdev-private-dpif.h \
lib/dpif-netdev-private-flow.h \
lib/dpif-netdev-private-hwol.h \
lib/dpif-netdev-private-thread.h \
diff --git a/lib/dpif-netdev-avx512.c b/lib/dpif-netdev-avx512.c
new file mode 100644
index 0..10228aeb0
--- /dev/null
+++ b/lib/dpif-netdev-avx512.c
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2020 Intel.
+ *
+ * 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.
+ */
+
+#ifdef __x86_64__
+/* Sparse cannot handle the AVX512 instructions */
+#if !defined(__CHECKER__)
+
+#include 
+
+#include "dpif-netdev.h"
+#include "dpif-netdev-perf.h"
+
+#include "dpif-netdev-private.h"
+#include "dpif-netdev-private-dpcls.h"
+#include "dpif-netdev-private-flow.h"
+#include "dpif-netdev-private-thread.h"
+
+#include "dp-packet.h"
+#include "netdev.h"
+
+#include "immintrin.h"
+
+/* Structure to contain per-packet metadata that must be attributed to the
+ * dp netdev flow. This is unfortunate to have to track per packet, however
+ * it's a bit awkward to maintain them in a performant way. This structure
+ * helps to keep two variables on a single cache line per packet.
+ */
+struct pkt_flow_meta {
+uint16_t bytes;
+uint16_t tcp_flags;
+};
+
+/* Structure of heap allocated memory for DPIF internals. */
+struct dpif_userdata {
+OVS_ALIGNED_VAR(CACHE_LINE_SIZE)
+struct netdev_flow_key keys[NETDEV_MAX_BURST];
+OVS_ALIGNED_VAR(CACHE_LINE_SIZE)
+struct netdev_flow_key *key_ptrs[NETDEV_MAX_BURST];
+OVS_ALIGNED_VAR(CACHE_LINE_SIZE)
+struct pkt_flow_meta pkt_meta[NETDEV_MAX_BURST];
+};
+
+int32_t
+dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread *pmd,
+ struct dp_packet_batch *packets,
+ odp_port_t in_port)
+{
+/* Allocate DPIF userdata. */
+if (OVS_UNLIKELY(!pmd->netdev_input_func_userdata)) {
+pmd->netdev_input_func_userdata =
+xmalloc_pagealign(sizeof(struct dpif_userdata));
+}
+
+struct dpif_userdata *ud = pmd->netdev_input_func_userdata;
+struct netdev_flow_key *keys = ud->keys;
+struct netdev_flow_key **key_ptrs = ud->key_ptrs;
+struct pkt_flow_meta *pkt_meta = ud->pkt_meta;
+
+/* Stores the computed output: a rule pointer for each packet */
+/* The AVX512 DPIF implementation handles rules in a way that is optimized
+ * for reducing data-movement between HWOL/EMC/SMC and DPCLS. This is
+ * achieved by separating the rule arrays. Bitmasks are kept for each
+ * packet, indicating if it matched in the HWOL/EMC/SMC array or DPCLS
+ * array. Later the two arrays are merged by AVX-512 expand instructions.
+ */
+struct dpcls_rule *rules[NETDEV_MAX_BURST];
+  

[ovs-dev] [PATCH v9 01/16] dpif-netdev: Refactor to multiple header files.

2021-02-12 Thread Harry van Haaren
Split the very large file dpif-netdev.c and the datastructures
it contains into multiple header files. Each header file is
responsible for the datastructures of that component.

This logical split allows better reuse and modularity of the code,
and reduces the very large file dpif-netdev.c to be more managable.

Due to dependencies between components, it is not possible to
move component in smaller granularities than this patch.

To explain the dependencies better, eg:

DPCLS has no deps (from dpif-netdev.c file)
FLOW depends on DPCLS (struct dpcls_rule)
DFC depends on DPCLS (netdev_flow_key) and FLOW (netdev_flow_key)
THREAD depends on DFC (struct dfc_cache)

DFC_PROC depends on THREAD (struct pmd_thread)

DPCLS lookup.h/c require only DPCLS
DPCLS implementations require only dpif-netdev-lookup.h.
- This change was made in 2.12 release with function pointers
- This commit only refactors the name to "private-dpcls.h"

Signed-off-by: Harry van Haaren 
Co-authored-by: Cian Ferriter 
Signed-off-by: Cian Ferriter 
---
 lib/automake.mk|   4 +
 lib/dpif-netdev-lookup-autovalidator.c |   1 -
 lib/dpif-netdev-lookup-avx512-gather.c |   1 -
 lib/dpif-netdev-lookup-generic.c   |   1 -
 lib/dpif-netdev-lookup.h   |   2 +-
 lib/dpif-netdev-private-dfc.h  | 244 
 lib/dpif-netdev-private-dpcls.h| 129 ++
 lib/dpif-netdev-private-flow.h | 162 
 lib/dpif-netdev-private-thread.h   | 206 ++
 lib/dpif-netdev-private.h  | 100 +
 lib/dpif-netdev.c  | 519 +
 11 files changed, 760 insertions(+), 609 deletions(-)
 create mode 100644 lib/dpif-netdev-private-dfc.h
 create mode 100644 lib/dpif-netdev-private-dpcls.h
 create mode 100644 lib/dpif-netdev-private-flow.h
 create mode 100644 lib/dpif-netdev-private-thread.h

diff --git a/lib/automake.mk b/lib/automake.mk
index 39afbff9d..0e83145b5 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -111,6 +111,10 @@ lib_libopenvswitch_la_SOURCES = \
lib/dpif-netdev-lookup-generic.c \
lib/dpif-netdev.c \
lib/dpif-netdev.h \
+   lib/dpif-netdev-private-dfc.h \
+   lib/dpif-netdev-private-dpcls.h \
+   lib/dpif-netdev-private-flow.h \
+   lib/dpif-netdev-private-thread.h \
lib/dpif-netdev-private.h \
lib/dpif-netdev-perf.c \
lib/dpif-netdev-perf.h \
diff --git a/lib/dpif-netdev-lookup-autovalidator.c 
b/lib/dpif-netdev-lookup-autovalidator.c
index 97b59fdd0..475e1ab1e 100644
--- a/lib/dpif-netdev-lookup-autovalidator.c
+++ b/lib/dpif-netdev-lookup-autovalidator.c
@@ -17,7 +17,6 @@
 #include 
 #include "dpif-netdev.h"
 #include "dpif-netdev-lookup.h"
-#include "dpif-netdev-private.h"
 #include "openvswitch/vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(dpif_lookup_autovalidator);
diff --git a/lib/dpif-netdev-lookup-avx512-gather.c 
b/lib/dpif-netdev-lookup-avx512-gather.c
index 5e3634249..8fc1cdfa5 100644
--- a/lib/dpif-netdev-lookup-avx512-gather.c
+++ b/lib/dpif-netdev-lookup-avx512-gather.c
@@ -21,7 +21,6 @@
 
 #include "dpif-netdev.h"
 #include "dpif-netdev-lookup.h"
-#include "dpif-netdev-private.h"
 #include "cmap.h"
 #include "flow.h"
 #include "pvector.h"
diff --git a/lib/dpif-netdev-lookup-generic.c b/lib/dpif-netdev-lookup-generic.c
index b1a0cfc36..e3b6be4b6 100644
--- a/lib/dpif-netdev-lookup-generic.c
+++ b/lib/dpif-netdev-lookup-generic.c
@@ -17,7 +17,6 @@
 
 #include 
 #include "dpif-netdev.h"
-#include "dpif-netdev-private.h"
 #include "dpif-netdev-lookup.h"
 
 #include "bitmap.h"
diff --git a/lib/dpif-netdev-lookup.h b/lib/dpif-netdev-lookup.h
index bd72aa29b..59f51faa0 100644
--- a/lib/dpif-netdev-lookup.h
+++ b/lib/dpif-netdev-lookup.h
@@ -19,7 +19,7 @@
 
 #include 
 #include "dpif-netdev.h"
-#include "dpif-netdev-private.h"
+#include "dpif-netdev-private-dpcls.h"
 
 /* Function to perform a probe for the subtable bit fingerprint.
  * Returns NULL if not valid, or a valid function pointer to call for this
diff --git a/lib/dpif-netdev-private-dfc.h b/lib/dpif-netdev-private-dfc.h
new file mode 100644
index 0..8f6a4899e
--- /dev/null
+++ b/lib/dpif-netdev-private-dfc.h
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015 Nicira, Inc.
+ * Copyright (c) 2019, 2020 Intel Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef DPIF_NETDEV_PRIVATE_DFC_H
+#define DPIF_NETDEV_PRIVATE_DFC_H 1
+
+#include 

[ovs-dev] [PATCH v9 03/16] dpif-netdev: Add function pointer for netdev input.

2021-02-12 Thread Harry van Haaren
This commit adds a function pointer to the pmd thread data structure,
giving the pmd thread flexibility in its dpif-input function choice.
This allows choosing of the implementation based on ISA capabilities
of the runtime CPU, leading to optimizations and higher performance.

Signed-off-by: Harry van Haaren 
---
 lib/dpif-netdev-private-thread.h | 12 
 lib/dpif-netdev.c|  7 ++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/lib/dpif-netdev-private-thread.h b/lib/dpif-netdev-private-thread.h
index a5b3ae360..089223aaf 100644
--- a/lib/dpif-netdev-private-thread.h
+++ b/lib/dpif-netdev-private-thread.h
@@ -47,6 +47,13 @@ struct dp_netdev_pmd_thread_ctx {
 uint32_t emc_insert_min;
 };
 
+/* Forward declaration for typedef */
+struct dp_netdev_pmd_thread;
+
+typedef void (*dp_netdev_input_func)(struct dp_netdev_pmd_thread *pmd,
+ struct dp_packet_batch *packets,
+ odp_port_t port_no);
+
 /* PMD: Poll modes drivers.  PMD accesses devices via polling to eliminate
  * the performance overhead of interrupt processing.  Therefore netdev can
  * not implement rx-wait for these devices.  dpif-netdev needs to poll
@@ -101,6 +108,11 @@ struct dp_netdev_pmd_thread {
 /* Current context of the PMD thread. */
 struct dp_netdev_pmd_thread_ctx ctx;
 
+/* Function pointer to call for dp_netdev_input() functionality. */
+dp_netdev_input_func netdev_input_func;
+/* Pointer for per-DPIF implementation scratch space. */
+void *netdev_input_func_userdata;
+
 struct seq *reload_seq;
 uint64_t last_reload_seq;
 
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 840298f01..c0cf44852 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4220,8 +4220,9 @@ dp_netdev_process_rxq_port(struct dp_netdev_pmd_thread 
*pmd,
 }
 }
 }
+
 /* Process packet batch. */
-dp_netdev_input(pmd, &batch, port_no);
+pmd->netdev_input_func(pmd, &batch, port_no);
 
 /* Assign processing cycles to rx queue. */
 cycles = cycle_timer_stop(&pmd->perf_stats, &timer);
@@ -6005,6 +6006,10 @@ dp_netdev_configure_pmd(struct dp_netdev_pmd_thread 
*pmd, struct dp_netdev *dp,
 hmap_init(&pmd->tnl_port_cache);
 hmap_init(&pmd->send_port_cache);
 cmap_init(&pmd->tx_bonds);
+
+/* Initialize the DPIF function pointer to the default scalar version */
+pmd->netdev_input_func = dp_netdev_input;
+
 /* init the 'flow_cache' since there is no
  * actual thread created for NON_PMD_CORE_ID. */
 if (core_id == NON_PMD_CORE_ID) {
-- 
2.25.1

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


[ovs-dev] [PATCH v9 00/16] DPIF Framework + Optimizations

2021-02-12 Thread Harry van Haaren
v9 Summary:
- Added AVX512 POC work for DPIF and MFEX in single patch at end
-- Note that the AVX512 MFEX is for Ether()/IP()/UDP() traffic.
-- A significant performance boost is possible with these optimizations.

v8 Summary:
- Added NEWS entries for significant changes
- Added scalar optimizations for datapath TX
- Patchset is now ready for merge in my opinion.

v7 summary:
- OVS Conference included DPIF overview, youtube link:
--- https://youtu.be/5dWyPxiXEhg
- Rebased and tested on the DPDK 20.11 v4 patch
--- Link: https://patchwork.ozlabs.org/project/openvswitch/list/?series=220645
--- Tested this series for shared/static builds
--- Tested this series with/without -march=
- Minor code improvements in DPIF component (see commits for details)
- Improved CPU ISA checks, caching results
- Commit message improvements (.'s etc)
- Added performance data of patchset
--- Note that the benchmark below does not utilize the AVX512-vpopcntdq
--- optimizations, and performance is expected to improve when used.
--- Further optimizations are planned that continue.

Benchmark Details & Results
===

Intel® Xeon® Gold 6230 CPU @2.10GHz
OVS*-DPDK* Phy-Phy Performance 4x 25G Ports - Total 1 million flows
1C1T-4P, 64-byte frame size, performance in mpps:

Results Table:
---
DPIF  | Scalar | Scalar | AVX512 | AVX512 |
DPCLS | Scalar | AVX512 | Scalar | AVX512 |
---
mpps  |  6.955 |  7.530 |  7.530 |  7.962 |

By enabling both AVX512 DPIF and DPCLS, packet forwarding
is  7.962 / 6.955 = 1.1447x faster, aka 14% speedup.



v6 summary:
- Rebase to DPDK 20.11 enabling patch
--- This creates a dependency, expect CI build failures on the last
patch in this series if it is not applied!
- Small improvements to DPIF layer
--- EMC/SMC enabling in AVX512 DPIF cleanups
- CPU ISA flags are cached, lowering overhead
- Wilcard Classifier DPCLS
--- Refactor and cleanups for function names
--- Enable more subtable specializations
--- Enable AVX512 vpopcount instruction


v5 summary:
- Dropped MFEX optimizations, re-targetting to a later release
--- This allows focus of community reviews & development on DPIF
--- Note OVS Conference talk still introduces both DPIF and MFEX topics
- DPIF improvements
--- Better EMC/SMC handling
--- HWOL is enabled in the avx512 DPIF
--- Documentation & NEWS items added
--- Various smaller improvements

v4 summary:
- Updated and improve DPIF component
--- SMC now implemented
--- EMC handling improved
--- Novel batching method using AVX512 implemented
--- see commits for details
- Updated Miniflow Extract component
--- Improved AVX512 code path performance
--- Implemented multiple TODO item's in v3
--- Add "disable" implementation to return to scalar miniflow only
--- More fixes planned for v5/future revisions:
 Rename command to better reflect usage
 Improve dynamicness of patterns
 Add more demo protocols to show usage
- Future work
--- Documentation/NEWS items
--- Statistics for optimized MFEX
- Note that this patchset will be discussed/presented at OvsConf soon :)

v3 update summary:
(Cian Ferriter helping with rebases, review and code cleanups)
- Split out partially related changes (these will be sent separately)
--- netdev output action optimization
--- avx512 dpcls 16-block support optimization
- Squash commit which moves netdev struct flow into the refactor commit:
--- Squash dpif-netdev: move netdev flow struct to header
--- Into dpif-netdev: Refactor to multiple header files
- Implement Miniflow extract for AVX-512 DPIF
--- A generic method of matching patterns and packets is implemented,
providing traffic-pattern specific miniflow-extract acceleration.
--- The patterns today are hard-coded, however in a future patchset it
is intended to make these runtime configurable, allowing users to
optimize the SIMD miniflow extract for active traffic types.
- Notes:
--- 32 bit builds will be fixed in next release by adding flexible
miniflow extract optimization selection.
--- AVX-512 VBMI ISA is not yet supported in OVS due to requiring the
DPDK 20.11 update for RTE_CPUFLAG_*. Once on a newer DPDK this will
be added.

v2 updates:
- Includes DPIF command switching at runtime
- Includes AVX512 DPIF implementation
- Includes some partially related changes (can be split out of set?)
--- netdev output action optimization
--- avx512 dpcls 16-block support optimization


This patchset is a v7 for making the DPIF components of the
userspace datapath more flexible. It has been refactored to be
more modular to encourage code-reuse, and scalable in that ISA
optimized implementations can be added and selected at runtime.

The same approach as has been previously used for DPCLS is used
here, where a function pointer allows selection of an implementation
at runtime.

Datapath features such as EMC, SMC and HWOL are shared between
implementations, hence they are refactored into seperat

Re: [ovs-dev] [OVN Patch v14 2/3] ovn-northd: Introduce parallel lflow build

2021-02-12 Thread 0-day Robot
Bleep bloop.  Greetings Anton Ivanov, I am a robot and I have tried out your 
patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Line is 80 characters long (recommended limit is 79)
#155 FILE: northd/ovn-northd.c:11564:
HMAP_FOR_EACH_IN_PARALLEL (od, key_node, bnum, lsi->datapaths) {

WARNING: Line is 85 characters long (recommended limit is 79)
#310 FILE: northd/ovn-northd.c:11680:
lflow_segs = xcalloc(sizeof(*lflow_segs), 
build_lflows_pool->pool->size);

WARNING: Line is 82 characters long (recommended limit is 79)
#342 FILE: northd/ovn-northd.c:11712:
run_pool_callback(build_lflows_pool->pool, NULL, NULL, 
noop_callback);

Lines checked: 454, Warnings: 3, Errors: 0


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [OVN Patch v14 1/3] ovn-libs: Add support for parallel processing

2021-02-12 Thread 0-day Robot
Bleep bloop.  Greetings Anton Ivanov, I am a robot and I have tried out your 
patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Line is 83 characters long (recommended limit is 79)
#187 FILE: lib/ovn-parallel-hmap.c:146:
ovs_thread_create("worker pool helper", start, 
&new_pool->controls[i]);

WARNING: Line has trailing whitespace
#466 FILE: lib/ovn-parallel-hmap.c:425:
} 

ERROR: Improper whitespace around control block
#562 FILE: lib/ovn-parallel-hmap.h:60:
#define HMAP_FOR_EACH_IN_PARALLEL(NODE, MEMBER, JOBID, HMAP) \

WARNING: Line has trailing whitespace
#736 FILE: lib/ovn-parallel-hmap.h:234:
hrl->row_locks = NULL;   

Lines checked: 790, Warnings: 3, Errors: 1


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [OVN Patch v14 2/3] ovn-northd: Introduce parallel lflow build

2021-02-12 Thread Anton Ivanov
Datapaths, ports, igmp groups and load balancers can now
be iterated over in parallel in order to speed up the lflow
generation. This decreases the time needed to generate the
logical flows by a factor of 4+ on a 6 core/12 thread CPU
without datapath groups - from 0.8-1 microseconds per flow
down to 0.2-0.3 microseconds per flow on average.

The decrease in time to compute lflows with datapath groups
enabled is ~2 times for the same hardware - from an average of
2.4 microseconds per flow to 1.2 microseconds per flow.

Tested for on an 8 node, 400 pod K8 simulation resulting
in > 6K flows.

Signed-off-by: Anton Ivanov 
---
 northd/ovn-northd.c | 325 
 1 file changed, 272 insertions(+), 53 deletions(-)

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index b2b5f6a1b..c8cdc4861 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -39,6 +39,7 @@
 #include "lib/ovn-util.h"
 #include "lib/lb.h"
 #include "memory.h"
+#include "lib/ovn-parallel-hmap.h"
 #include "ovn/actions.h"
 #include "ovn/features.h"
 #include "ovn/logical-fields.h"
@@ -3977,6 +3978,34 @@ ovn_lflow_init(struct ovn_lflow *lflow, struct 
ovn_datapath *od,
 /* If this option is 'true' northd will combine logical flows that differs by
  * logical datapath only by creating a datapah group. */
 static bool use_logical_dp_groups = false;
+static bool use_parallel_build = true;
+
+static struct hashrow_locks lflow_locks;
+
+/* Adds a row with the specified contents to the Logical_Flow table.
+ * Version to use when locking is required.
+ */
+static void
+do_ovn_lflow_add(struct hmap *lflow_map, bool shared,
+struct ovn_datapath *od,
+uint32_t hash, struct ovn_lflow *lflow)
+{
+
+struct ovn_lflow *old_lflow;
+
+if (shared && use_logical_dp_groups) {
+old_lflow = ovn_lflow_find_by_lflow(lflow_map, lflow, hash);
+if (old_lflow) {
+ovn_lflow_destroy(NULL, lflow);
+hmapx_add(&old_lflow->od_group, od);
+return;
+}
+}
+
+hmapx_add(&lflow->od_group, od);
+hmap_insert_fast(lflow_map, &lflow->hmap_node, hash);
+}
+
 
 /* Adds a row with the specified contents to the Logical_Flow table. */
 static void
@@ -3987,7 +4016,7 @@ ovn_lflow_add_at(struct hmap *lflow_map, struct 
ovn_datapath *od,
 {
 ovs_assert(ovn_stage_to_datapath_type(stage) == ovn_datapath_get_type(od));
 
-struct ovn_lflow *old_lflow, *lflow;
+struct ovn_lflow *lflow;
 uint32_t hash;
 
 lflow = xmalloc(sizeof *lflow);
@@ -3999,17 +4028,14 @@ ovn_lflow_add_at(struct hmap *lflow_map, struct 
ovn_datapath *od,
ovn_lflow_hint(stage_hint), where);
 
 hash = ovn_lflow_hash(lflow);
-if (shared && use_logical_dp_groups) {
-old_lflow = ovn_lflow_find_by_lflow(lflow_map, lflow, hash);
-if (old_lflow) {
-ovn_lflow_destroy(NULL, lflow);
-hmapx_add(&old_lflow->od_group, od);
-return;
-}
-}
 
-hmapx_add(&lflow->od_group, od);
-hmap_insert(lflow_map, &lflow->hmap_node, hash);
+if (use_logical_dp_groups && use_parallel_build) {
+lock_hash_row(&lflow_locks, hash);
+do_ovn_lflow_add(lflow_map, shared, od, hash, lflow);
+unlock_hash_row(&lflow_locks, hash);
+} else {
+do_ovn_lflow_add(lflow_map, shared, od, hash, lflow);
+}
 }
 
 /* Adds a row with the specified contents to the Logical_Flow table. */
@@ -7158,6 +7184,8 @@ build_lswitch_ip_mcast_igmp_mld(struct ovn_igmp_group 
*igmp_group,
 }
 }
 
+static struct ovs_mutex mcgroup_mutex = OVS_MUTEX_INITIALIZER;
+
 /* Ingress table 19: Destination lookup, unicast handling (priority 50), */
 static void
 build_lswitch_ip_unicast_lookup(struct ovn_port *op,
@@ -7196,7 +7224,9 @@ build_lswitch_ip_unicast_lookup(struct ovn_port *op,
 &op->nbsp->header_);
 } else if (!strcmp(op->nbsp->addresses[i], "unknown")) {
 if (lsp_is_enabled(op->nbsp)) {
+ovs_mutex_lock(&mcgroup_mutex);
 ovn_multicast_add(mcgroups, &mc_unknown, op);
+ovs_mutex_unlock(&mcgroup_mutex);
 op->od->has_unknown = true;
 }
 } else if (is_dynamic_lsp_address(op->nbsp->addresses[i])) {
@@ -11505,6 +11535,120 @@ build_lswitch_and_lrouter_iterate_by_op(struct 
ovn_port *op,
 &lsi->match, &lsi->actions);
 }
 
+struct lflows_thread_pool {
+struct worker_pool *pool;
+};
+
+static void *build_lflows_thread(void *arg)
+{
+struct worker_control *control = (struct worker_control *) arg;
+struct lflows_thread_pool *workload;
+struct lswitch_flow_build_info *lsi;
+
+struct ovn_datapath *od;
+struct ovn_port *op;
+struct ovn_northd_lb *lb;
+struct ovn_igmp_group *igmp_group;
+int bnum;
+
+while (!stop_parallel_processing()) {
+  

[ovs-dev] [OVN Patch v14 3/3] ovn-northd: Add configuration option for parallel lflow build

2021-02-12 Thread Anton Ivanov
Signed-off-by: Anton Ivanov 
---
 northd/ovn-northd.c |  3 +++
 ovn-nb.xml  | 13 +
 2 files changed, 16 insertions(+)

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index c8cdc4861..e95cfa556 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -12850,6 +12850,9 @@ ovnnb_db_run(struct northd_context *ctx,
 northd_probe_interval_nb = get_probe_interval(ovnnb_db, nb);
 northd_probe_interval_sb = get_probe_interval(ovnsb_db, nb);
 
+use_parallel_build = smap_get_bool(&nb->options,
+  "use_parallel_build", false) &&
+  ovn_can_parallelize_hashes(false);
 use_logical_dp_groups = smap_get_bool(&nb->options,
   "use_logical_dp_groups", false);
 /* deprecated, use --event instead */
diff --git a/ovn-nb.xml b/ovn-nb.xml
index a94918bb6..fd8f9c096 100644
--- a/ovn-nb.xml
+++ b/ovn-nb.xml
@@ -213,6 +213,19 @@
   The default value is false.
 
   
+  
+
+  If set to true, ovn-northd will attempt
+  to compute logical flows in parallel.
+
+
+  Parallel computation is enabled only if the system has 4 or more
+  cores/threads available to be used by ovn-northd.
+
+
+  The default value is false.
+
+  
 
   
 
-- 
2.20.1

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


[ovs-dev] [OVN Patch v14 1/3] ovn-libs: Add support for parallel processing

2021-02-12 Thread Anton Ivanov
This adds a set of functions and macros intended to process
hashes in parallel.

The principles of operation are documented in the fasthmap.h

If these one day go into the OVS tree, the OVS tree versions
would be used in preference.

Signed-off-by: Anton Ivanov 
---
 lib/automake.mk |   2 +
 lib/ovn-parallel-hmap.c | 455 
 lib/ovn-parallel-hmap.h | 285 +
 3 files changed, 742 insertions(+)
 create mode 100644 lib/ovn-parallel-hmap.c
 create mode 100644 lib/ovn-parallel-hmap.h

diff --git a/lib/automake.mk b/lib/automake.mk
index 250c7aefa..781be2109 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -13,6 +13,8 @@ lib_libovn_la_SOURCES = \
lib/expr.c \
lib/extend-table.h \
lib/extend-table.c \
+   lib/ovn-parallel-hmap.h \
+   lib/ovn-parallel-hmap.c \
lib/ip-mcast-index.c \
lib/ip-mcast-index.h \
lib/mcast-group-index.c \
diff --git a/lib/ovn-parallel-hmap.c b/lib/ovn-parallel-hmap.c
new file mode 100644
index 0..06aa95aba
--- /dev/null
+++ b/lib/ovn-parallel-hmap.c
@@ -0,0 +1,455 @@
+/*
+ * Copyright (c) 2020 Red Hat, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2012, 2013, 2015, 2019 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "fatal-signal.h"
+#include "util.h"
+#include "openvswitch/vlog.h"
+#include "openvswitch/hmap.h"
+#include "openvswitch/thread.h"
+#include "ovn-parallel-hmap.h"
+#include "ovs-atomic.h"
+#include "ovs-thread.h"
+#include "ovs-numa.h"
+#include "random.h"
+
+VLOG_DEFINE_THIS_MODULE(ovn_parallel_hmap);
+
+#ifndef OVS_HAS_PARALLEL_HMAP
+
+#define WORKER_SEM_NAME "%x-%p-%x"
+#define MAIN_SEM_NAME "%x-%p-main"
+
+/* These are accessed under mutex inside add_worker_pool().
+ * They do not need to be atomic.
+ */
+
+static atomic_bool initial_pool_setup = ATOMIC_VAR_INIT(false);
+static bool can_parallelize = false;
+
+/* This is set only in the process of exit and the set is
+ * accompanied by a fence. It does not need to be atomic or be
+ * accessed under a lock.
+ */
+
+static bool workers_must_exit = false;
+
+static struct ovs_list worker_pools = OVS_LIST_INITIALIZER(&worker_pools);
+
+static struct ovs_mutex init_mutex = OVS_MUTEX_INITIALIZER;
+
+static int pool_size;
+
+static int sembase;
+
+static void worker_pool_hook(void *aux OVS_UNUSED);
+static void setup_worker_pools(bool force);
+static void merge_list_results(struct worker_pool *pool OVS_UNUSED,
+   void *fin_result, void *result_frags,
+   int index);
+static void merge_hash_results(struct worker_pool *pool OVS_UNUSED,
+   void *fin_result, void *result_frags,
+   int index);
+
+bool ovn_stop_parallel_processing(void)
+{
+return workers_must_exit;
+}
+
+bool ovn_can_parallelize_hashes(bool force_parallel)
+{
+bool test = false;
+
+if (atomic_compare_exchange_strong(
+&initial_pool_setup,
+&test,
+true)) {
+ovs_mutex_lock(&init_mutex);
+setup_worker_pools(force_parallel);
+ovs_mutex_unlock(&init_mutex);
+}
+return can_parallelize;
+}
+
+struct worker_pool *ovn_add_worker_pool(void *(*start)(void *)){
+
+struct worker_pool *new_pool = NULL;
+struct worker_control *new_control;
+bool test = false;
+int i;
+char sem_name[256];
+
+
+/* Belt and braces - initialize the pool system just in case if
+ * if it is not yet initialized.
+ */
+
+if (atomic_compare_exchange_strong(
+&initial_pool_setup,
+&test,
+true)) {
+ovs_mutex_lock(&init_mutex);
+setup_worker_pools(false);
+ovs_mutex_unlock(&init_mutex);
+}
+
+ovs_mutex_lock(&init_mutex);
+if (can_parallelize) {
+new_pool = xmalloc(sizeof(struct worker_pool));
+new_pool->size = pool_size;
+new_pool->controls = NULL;
+sprintf(sem_name, MAIN_SEM_NAME, sembase, new_pool);
+new_pool->done = sem_open(sem_name, O_CREAT, S_IRWXU, 0);
+if (new_pool->done == SEM_FAILED) {
+goto cleanup;
+}
+
+new_pool->controls =
+xmalloc(sizeof(struct worker_control) * new_pool->size);
+
+for (i = 0; i < new_pool->size; i++) {
+new_contr

Re: [ovs-dev] [PATCH v2] faq: Update OVS/DPDK version table for OVS 2.15.

2021-02-12 Thread Stokes, Ian
> Indicate that OVS 2.15 uses DPDK 20.11.
> 
> Signed-off-by: Hariprasad Govindharajan
> 
> Acked-by: Kevin Traynor 

Thanks for this Hari, will apply to master and 2.15.

Thanks
Ian
> ---
> v2:
> amended the commit message based on review comments
> ---
>  Documentation/faq/releases.rst | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
> index 9638d31..6a5e414 100644
> --- a/Documentation/faq/releases.rst
> +++ b/Documentation/faq/releases.rst
> @@ -206,6 +206,7 @@ Q: What DPDK version does each Open vSwitch release
> work with?
>  2.12.x   18.11.9
>  2.13.x   19.11.2
>  2.14.x   19.11.2
> +2.15.x   20.11.0
>   
> 
>  Q: Are all the DPDK releases that OVS versions work with maintained?
> --
> 2.7.4
> 
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2] faq: Update OVS/DPDK version table for OVS 2.15.

2021-02-12 Thread Hariprasad Govindharajan
Indicate that OVS 2.15 uses DPDK 20.11.

Signed-off-by: Hariprasad Govindharajan 
Acked-by: Kevin Traynor 
---
v2:
amended the commit message based on review comments
---
 Documentation/faq/releases.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 9638d31..6a5e414 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -206,6 +206,7 @@ Q: What DPDK version does each Open vSwitch release work 
with?
 2.12.x   18.11.9
 2.13.x   19.11.2
 2.14.x   19.11.2
+2.15.x   20.11.0
  
 
 Q: Are all the DPDK releases that OVS versions work with maintained?
-- 
2.7.4

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


Re: [ovs-dev] [PATCH] faq: Update OVS/DPDK version table for OVS 2.15

2021-02-12 Thread Govindharajan, Hariprasad



> -Original Message-
> From: dev  On Behalf Of Kevin Traynor
> Sent: Thursday, February 11, 2021 5:51 PM
> To: ovs-dev@openvswitch.org
> Subject: Re: [ovs-dev] [PATCH] faq: Update OVS/DPDK version table for OVS
> 2.15
> 
> On 11/02/2021 14:10, hgovindh wrote:
> > Indicate that OVS 2.15 uses DPDK 20.11
> >
> > Signed-off-by: hgovindh 
> 
> Just a few style nits about the commit message for future reference, the title
> and sentence are missing full stops and names for DCO are normally in
> natural form, not username.
> 
> It's not worth a resend, unless the maintainers insist about the DCO.
> 
> > ---
> >  Documentation/faq/releases.rst | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/faq/releases.rst
> > b/Documentation/faq/releases.rst index 9638d31..6a5e414 100644
> > --- a/Documentation/faq/releases.rst
> > +++ b/Documentation/faq/releases.rst
> > @@ -206,6 +206,7 @@ Q: What DPDK version does each Open vSwitch
> release work with?
> >  2.12.x   18.11.9
> >  2.13.x   19.11.2
> >  2.14.x   19.11.2
> > +2.15.x   20.11.0
> >   
> >
> >  Q: Are all the DPDK releases that OVS versions work with maintained?
> >
> 
> Acked-by: Kevin Traynor 
> 
[Govindharajan, Hariprasad] Hi Kevin
Thanks for the feedback. I will send a v2 sooner today.
> ___
> 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] docs: Update for auto load balance threshold parameters.

2021-02-12 Thread Stokes, Ian
> On 2/11/21 8:31 PM, Kevin Traynor wrote:
> > Update the docs to remove the previously hardcoded values
> > and mention the load and improvement thresholds when
> > describing the operation of auto load balance.
> >
> > Fixes: 62ab5594c20c ("dpif-netdev: Add parameters to configure PMD auto
> load balance.")
> > Signed-off-by: Kevin Traynor 
> 
> I didn't test the documentation build, but the text looks
> good to me:
> 
> Acked-by: Ilya Maximets 

LGTM as well, will apply to master and 2.15.

Regards
Ian
> 
> > ---
> >  Documentation/topics/dpdk/pmd.rst | 21 ++---
> >  1 file changed, 18 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/topics/dpdk/pmd.rst
> b/Documentation/topics/dpdk/pmd.rst
> > index 6f1fdcbc6..caa7d97be 100644
> > --- a/Documentation/topics/dpdk/pmd.rst
> > +++ b/Documentation/topics/dpdk/pmd.rst
> > @@ -211,6 +211,13 @@ If any of above is not met PMD Auto Load Balancing
> is disabled.
> >  Once auto load balancing is set, each non-isolated PMD measures the
> processing
> >  load for each of its associated queues every 10 seconds. If the aggregated
> PMD
> > -load reaches 95% for 6 consecutive intervals then PMD considers itself to 
> > be
> > -overloaded.
> > +load reaches the load threshold for 6 consecutive intervals then PMD
> considers
> > +itself to be overloaded.
> > +
> > +For example, to set the load threshold to 70%::
> > +
> > +$ ovs-vsctl set open_vswitch .\
> > +other_config:pmd-auto-lb-load-threshold="70"
> > +
> > +If not set, the default load threshold is 95%.
> >
> >  If any PMD is overloaded, a dry-run of the PMD assignment algorithm is
> > @@ -219,5 +226,13 @@ to PMD assignments.
> >
> >  If the resultant mapping of dry-run indicates an improved distribution of 
> > the
> > -load then the actual reassignment will be performed.
> > +load by at least the variance improvement threshold then the actual
> > +reassignment will be performed.
> > +
> > +For example, to set the variance improvement threshold to 40%::
> > +
> > +$ ovs-vsctl set open_vswitch .\
> > +other_config:pmd-auto-lb-improvement-threshold="40"
> > +
> > +If not set, the default variance improvement threshold is 25%.
> >
> >  .. note::
> >

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


Re: [ovs-dev] [PATCH v2] docs: Update for auto load balance threshold parameters.

2021-02-12 Thread Ilya Maximets
On 2/11/21 8:31 PM, Kevin Traynor wrote:
> Update the docs to remove the previously hardcoded values
> and mention the load and improvement thresholds when
> describing the operation of auto load balance.
> 
> Fixes: 62ab5594c20c ("dpif-netdev: Add parameters to configure PMD auto load 
> balance.")
> Signed-off-by: Kevin Traynor 

I didn't test the documentation build, but the text looks
good to me:

Acked-by: Ilya Maximets 

> ---
>  Documentation/topics/dpdk/pmd.rst | 21 ++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/topics/dpdk/pmd.rst 
> b/Documentation/topics/dpdk/pmd.rst
> index 6f1fdcbc6..caa7d97be 100644
> --- a/Documentation/topics/dpdk/pmd.rst
> +++ b/Documentation/topics/dpdk/pmd.rst
> @@ -211,6 +211,13 @@ If any of above is not met PMD Auto Load Balancing is 
> disabled.
>  Once auto load balancing is set, each non-isolated PMD measures the 
> processing
>  load for each of its associated queues every 10 seconds. If the aggregated 
> PMD
> -load reaches 95% for 6 consecutive intervals then PMD considers itself to be
> -overloaded.
> +load reaches the load threshold for 6 consecutive intervals then PMD 
> considers
> +itself to be overloaded.
> +
> +For example, to set the load threshold to 70%::
> +
> +$ ovs-vsctl set open_vswitch .\
> +other_config:pmd-auto-lb-load-threshold="70"
> +
> +If not set, the default load threshold is 95%.
>  
>  If any PMD is overloaded, a dry-run of the PMD assignment algorithm is
> @@ -219,5 +226,13 @@ to PMD assignments.
>  
>  If the resultant mapping of dry-run indicates an improved distribution of the
> -load then the actual reassignment will be performed.
> +load by at least the variance improvement threshold then the actual
> +reassignment will be performed.
> +
> +For example, to set the variance improvement threshold to 40%::
> +
> +$ ovs-vsctl set open_vswitch .\
> +other_config:pmd-auto-lb-improvement-threshold="40"
> +
> +If not set, the default variance improvement threshold is 25%.
>  
>  .. note::
> 

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


Re: [ovs-dev] [PATCH ovn] Add IGMP_Group to ovn-controller RBAC

2021-02-12 Thread Numan Siddique
On Thu, Feb 11, 2021 at 4:59 PM Frode Nordahl
 wrote:
>
> Thank you Pedro,
>
> We built a test package [0] with this patch and received confirmation
> it solved the problem.
>
> Acked-by: Frode Nordahl 


Thanks for the patch. I applied this patch to master.

Numan

>
> 0: https://bugs.launchpad.net/ubuntu/+source/ovn/+bug/1914988
>
>
> On Thu, Feb 11, 2021 at 10:55 AM Pedro Guimaraes
>  wrote:
> >
> > If RBAC and IGMP snooping are enabled, ovn-controllers need to
> > be able to register new entries to table IGMP_Group as requests
> > are detected.
> >
> > For that, ovn-controllers need to have read/write access to
> > IGMP_Group table.
> >
> > Signed-off-by: Pedro Guimaraes 
> > Reported-at: https://github.com/ovn-org/ovn/issues/77
> > ---
> >  northd/ovn-northd.c| 12 
> >  ovn-architecture.7.xml | 16 
> >  2 files changed, 28 insertions(+)
> >
> > diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
> > index b2b5f6a1b..39d798782 100644
> > --- a/northd/ovn-northd.c
> > +++ b/northd/ovn-northd.c
> > @@ -13009,6 +13009,10 @@ static const char *rbac_svc_monitor_auth[] =
> >  {""};
> >  static const char *rbac_svc_monitor_auth_update[] =
> >  {"status"};
> > +static const char *rbac_igmp_group_auth[] =
> > +{""};
> > +static const char *rbac_igmp_group_update[] =
> > +{"address", "chassis", "datapath", "ports"};
> >
> >  static struct rbac_perm_cfg {
> >  const char *table;
> > @@ -13067,6 +13071,14 @@ static struct rbac_perm_cfg {
> >  .update = rbac_svc_monitor_auth_update,
> >  .n_update = ARRAY_SIZE(rbac_svc_monitor_auth_update),
> >  .row = NULL
> > +},{
> > +.table = "IGMP_Group",
> > +.auth = rbac_igmp_group_auth,
> > +.n_auth = ARRAY_SIZE(rbac_igmp_group_auth),
> > +.insdel = true,
> > +.update = rbac_igmp_group_update,
> > +.n_update = ARRAY_SIZE(rbac_igmp_group_update),
> > +.row = NULL
> >  },{
> >  .table = NULL,
> >  .auth = NULL,
> > diff --git a/ovn-architecture.7.xml b/ovn-architecture.7.xml
> > index e5c9f9549..0eef9b739 100644
> > --- a/ovn-architecture.7.xml
> > +++ b/ovn-architecture.7.xml
> > @@ -2597,6 +2597,22 @@
> >  modified by ovn-controller.
> >
> >  
> > +
> > +IGMP_Group
> > +
> > +  
> > +Authorization: disabled (all clients are considered
> > +to be authorized).
> > +  
> > +  
> > +Insert/Delete: row insertion/deletion are permitted.
> > +  
> > +  
> > +Update: The columns address,
> > +chassis, datapath, and
> > +ports may be modified by ovn-controller.
> > +  
> > +
> >
> >
> >
> > --
> > 2.30.0
> >
> > ___
> > dev mailing list
> > d...@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
>
> --
> Frode Nordahl
> ___
> 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] Fix submodule build when using build directory.

2021-02-12 Thread Numan Siddique
On Fri, Feb 12, 2021 at 1:14 AM Numan Siddique  wrote:
>
> On Thu, Feb 11, 2021 at 11:33 PM Mark Michelson  wrote:
> >
> > The initial addition of OVS as a submodule made the assumption that the
> > build is being performed from the OVN source directory. However, some
> > devs create a separate build directory for OVN. This means the search
> > for the OVS source will fail.
> >
> > This fixes the problem by explicitly stating that he ovs submodule is
> > located in the ovn source directory.
> >
> > Signed-off-by: Mark Michelson 
>
> Acked-by: Numan Siddique 
>
> Thanks for fixing this issue.

I applied this patch to master.

FYI - This patch landed in the openvswitch patchwork.

Thanks
Numan

>
> Numan
>
> > ---
> >  Makefile.am  | 2 +-
> >  acinclude.m4 | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/Makefile.am b/Makefile.am
> > index 50376a1b6..80247b62d 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -159,7 +159,7 @@ noinst_HEADERS += $(EXTRA_DIST)
> >
> >  ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */'
> >  ro_shell = printf '\043 Generated automatically -- do not modify!-*- 
> > buffer-read-only: t -*-\n'
> > -submodules = $(shell grep 'path =' .gitmodules | sed -E 's/[\t ]*path 
> > =\s*(.*)/\1/g' | xargs)
> > +submodules = $(shell grep 'path =' $(srcdir)/.gitmodules | sed -E 's/[\t 
> > ]*path =\s*(.*)/\1/g' | xargs)
> >
> >  SUFFIXES += .in
> >  .in:
> > diff --git a/acinclude.m4 b/acinclude.m4
> > index 2f8755961..2ca15cb33 100644
> > --- a/acinclude.m4
> > +++ b/acinclude.m4
> > @@ -338,7 +338,7 @@ AC_DEFUN([OVN_CHECK_OVS], [
> >AC_ERROR([$OVSDIR is not an OVS source directory])
> >  fi
> >else
> > -OVSDIR=`pwd`/ovs
> > +OVSDIR=$srcdir/ovs
> >fi
> >
> >AC_MSG_RESULT([$OVSDIR])
> > --
> > 2.29.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