diff mbox series

[ovs-dev,v2] system-dpdk: Improve user configured mempool test.

Message ID 20220914083659.225297-1-sunil.pai.g@intel.com
State Accepted
Commit 3b786f5cff1273d0dc4d08706e3f5be5c7d85795
Headers show
Series [ovs-dev,v2] system-dpdk: Improve user configured mempool test. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Pai G, Sunil Sept. 14, 2022, 8:36 a.m. UTC
Improve the test by adding and varying the MTU of a DPDK null port to check if
relevant mempools are created/(re)used.

Signed-off-by: Sunil Pai G <sunil.pai.g@intel.com>

---
v1 -> v2: Use DPDK null port instead of vhost-user port.
---
 tests/system-dpdk.at | 39 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

Comments

Kevin Traynor Sept. 14, 2022, 9:28 a.m. UTC | #1
On 14/09/2022 10:36, Sunil Pai G wrote:
> Improve the test by adding and varying the MTU of a DPDK null port to check if
> relevant mempools are created/(re)used.
> 
> Signed-off-by: Sunil Pai G <sunil.pai.g@intel.com>
> 

Acked-by: Kevin Traynor <ktraynor@redhat.com>

> ---
> v1 -> v2: Use DPDK null port instead of vhost-user port.
> ---
>   tests/system-dpdk.at | 39 ++++++++++++++++++++++++++++++++++++---
>   1 file changed, 36 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
> index 15f97097a..6b41d6622 100644
> --- a/tests/system-dpdk.at
> +++ b/tests/system-dpdk.at
> @@ -1127,13 +1127,46 @@ OVS_DPDK_PRE_CHECK()
>   OVS_DPDK_START_OVSDB()
>   OVS_DPDK_START_VSWITCHD()
>   
> -AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:shared-mempool-config=9000,6000,1500])
> +AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:shared-mempool-config=8000,6000,1500])
>   AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true])
>   
> -CHECK_MEMPOOL_PARAM([9000], [ALL], [])
> +CHECK_MEMPOOL_PARAM([8000], [ALL], [])
>   CHECK_MEMPOOL_PARAM([6000], [ALL], [])
>   CHECK_MEMPOOL_PARAM([1500], [ALL], [])
>   
> -OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
> +AT_CHECK(ovs-appctl vlog/set netdev_dpdk:dbg)
> +
> +dnl Add userspace bridge and a dpdk port
> +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
> +AT_CHECK([ovs-vsctl add-port br10 p1 -- set Interface p1 type=dpdk options:dpdk-devargs=net_null0,no-rx=1], [], [stdout], [stderr])
> +AT_CHECK([ovs-vsctl show], [], [stdout])
> +sleep 2
> +
> +dnl Check if the right user configured mempool is found for default MTU (1500)
> +AT_CHECK([grep "Found user configured shared mempool .* suitable for port with MTU 1500" ovs-vswitchd.log], [], [stdout])
> +AT_CHECK([grep "Port p1: Requesting a mempool" ovs-vswitchd.log], [], [stdout])
> +
> +dnl Change the MTU value to 7000 to trigger mempool change
> +TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
> +AT_CHECK(ovs-vsctl set Interface p1 mtu_request=7000)
> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Found user configured shared mempool .* suitable for port with MTU 7000"])
> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Port p1: Requesting a mempool"])
> +
> +dnl Change back the MTU value to 1500 to trigger mempool change (re-use)
> +TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
> +AT_CHECK(ovs-vsctl set Interface p1 mtu_request=1500)
> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Found user configured shared mempool .* suitable for port with MTU 1500"])
> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Reusing mempool"])
> +
> +dnl Change the MTU value beyond the max value in shared-mempool-config list
> +TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
> +AT_CHECK(ovs-vsctl set Interface p1 mtu_request=9000)
> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "No user configured shared mempool mbuf sizes found suitable for port with MTU 9000"])
> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Port p1: Requesting a mempool"])
> +
> +dnl Clean up
> +AT_CHECK([ovs-vsctl del-port br10 p1], [], [stdout], [stderr])
> +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
> +])")
>   AT_CLEANUP
>   dnl --------------------------------------------------------------------------
Phelan, Michael Sept. 20, 2022, 2:37 p.m. UTC | #2
> -----Original Message-----
> From: dev <ovs-dev-bounces@openvswitch.org> On Behalf Of Sunil Pai G
> Sent: Wednesday 14 September 2022 09:37
> To: dev@openvswitch.org
> Cc: i.maximets@ovn.org
> Subject: [ovs-dev] [PATCH v2] system-dpdk: Improve user configured
> mempool test.
> 
> Improve the test by adding and varying the MTU of a DPDK null port to check
> if relevant mempools are created/(re)used.
> 
> Signed-off-by: Sunil Pai G <sunil.pai.g@intel.com>
> 
> ---
> v1 -> v2: Use DPDK null port instead of vhost-user port.
> ---
>  tests/system-dpdk.at | 39 ++++++++++++++++++++++++++++++++++++---
>  1 file changed, 36 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at index
> 15f97097a..6b41d6622 100644
> --- a/tests/system-dpdk.at
> +++ b/tests/system-dpdk.at
> @@ -1127,13 +1127,46 @@ OVS_DPDK_PRE_CHECK()
>  OVS_DPDK_START_OVSDB()
>  OVS_DPDK_START_VSWITCHD()
> 
> -AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:shared-
> mempool-config=9000,6000,1500])
> +AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch .
> +other_config:shared-mempool-config=8000,6000,1500])
>  AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-
> init=true])
> 
> -CHECK_MEMPOOL_PARAM([9000], [ALL], [])
> +CHECK_MEMPOOL_PARAM([8000], [ALL], [])
>  CHECK_MEMPOOL_PARAM([6000], [ALL], [])
>  CHECK_MEMPOOL_PARAM([1500], [ALL], [])
> 
> -OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
> +AT_CHECK(ovs-appctl vlog/set netdev_dpdk:dbg)
> +
> +dnl Add userspace bridge and a dpdk port AT_CHECK([ovs-vsctl add-br
> +br10 -- set bridge br10 datapath_type=netdev]) AT_CHECK([ovs-vsctl
> +add-port br10 p1 -- set Interface p1 type=dpdk
> +options:dpdk-devargs=net_null0,no-rx=1], [], [stdout], [stderr])
> +AT_CHECK([ovs-vsctl show], [], [stdout]) sleep 2
> +
> +dnl Check if the right user configured mempool is found for default MTU
> +(1500) AT_CHECK([grep "Found user configured shared mempool .*
> suitable
> +for port with MTU 1500" ovs-vswitchd.log], [], [stdout]) AT_CHECK([grep
> +"Port p1: Requesting a mempool" ovs-vswitchd.log], [], [stdout])
> +
> +dnl Change the MTU value to 7000 to trigger mempool change TMP=$(($(cat
> +ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1)) AT_CHECK(ovs-vsctl
> +set Interface p1 mtu_request=7000) OVS_WAIT_UNTIL([tail -n +$TMP
> +ovs-vswitchd.log | grep "Found user configured shared mempool .*
> +suitable for port with MTU 7000"]) OVS_WAIT_UNTIL([tail -n +$TMP
> +ovs-vswitchd.log | grep "Port p1: Requesting a mempool"])
> +
> +dnl Change back the MTU value to 1500 to trigger mempool change
> +(re-use) TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
> +AT_CHECK(ovs-vsctl set Interface p1 mtu_request=1500)
> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Found user
> +configured shared mempool .* suitable for port with MTU 1500"])
> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Reusing
> +mempool"])
> +
> +dnl Change the MTU value beyond the max value in shared-mempool-
> config
> +list TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
> +AT_CHECK(ovs-vsctl set Interface p1 mtu_request=9000)
> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "No user
> +configured shared mempool mbuf sizes found suitable for port with MTU
> +9000"]) OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Port p1:
> +Requesting a mempool"])
> +
> +dnl Clean up
> +AT_CHECK([ovs-vsctl del-port br10 p1], [], [stdout], [stderr])
> +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
> +])")
>  AT_CLEANUP
>  dnl --------------------------------------------------------------------------
> --
> 2.37.3
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Hey Sunil,
I tested your patch with different AVX-512 configurations and NICs and everything looked good to me.

Tested-by: Michael Phelan <michael.phelan@intel.com>

Thanks,
Michael.
Ilya Maximets Sept. 26, 2022, 11:58 p.m. UTC | #3
On 9/20/22 16:37, Phelan, Michael wrote:
> 
>> -----Original Message-----
>> From: dev <ovs-dev-bounces@openvswitch.org> On Behalf Of Sunil Pai G
>> Sent: Wednesday 14 September 2022 09:37
>> To: dev@openvswitch.org
>> Cc: i.maximets@ovn.org
>> Subject: [ovs-dev] [PATCH v2] system-dpdk: Improve user configured
>> mempool test.
>>
>> Improve the test by adding and varying the MTU of a DPDK null port to check
>> if relevant mempools are created/(re)used.
>>
>> Signed-off-by: Sunil Pai G <sunil.pai.g@intel.com>
>>
>> ---
>> v1 -> v2: Use DPDK null port instead of vhost-user port.
>> ---
>>  tests/system-dpdk.at | 39 ++++++++++++++++++++++++++++++++++++---
>>  1 file changed, 36 insertions(+), 3 deletions(-)
>>
>> diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at index
>> 15f97097a..6b41d6622 100644
>> --- a/tests/system-dpdk.at
>> +++ b/tests/system-dpdk.at
>> @@ -1127,13 +1127,46 @@ OVS_DPDK_PRE_CHECK()
>>  OVS_DPDK_START_OVSDB()
>>  OVS_DPDK_START_VSWITCHD()
>>
>> -AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:shared-
>> mempool-config=9000,6000,1500])
>> +AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch .
>> +other_config:shared-mempool-config=8000,6000,1500])
>>  AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-
>> init=true])
>>
>> -CHECK_MEMPOOL_PARAM([9000], [ALL], [])
>> +CHECK_MEMPOOL_PARAM([8000], [ALL], [])
>>  CHECK_MEMPOOL_PARAM([6000], [ALL], [])
>>  CHECK_MEMPOOL_PARAM([1500], [ALL], [])
>>
>> -OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
>> +AT_CHECK(ovs-appctl vlog/set netdev_dpdk:dbg)
>> +
>> +dnl Add userspace bridge and a dpdk port AT_CHECK([ovs-vsctl add-br
>> +br10 -- set bridge br10 datapath_type=netdev]) AT_CHECK([ovs-vsctl
>> +add-port br10 p1 -- set Interface p1 type=dpdk
>> +options:dpdk-devargs=net_null0,no-rx=1], [], [stdout], [stderr])
>> +AT_CHECK([ovs-vsctl show], [], [stdout]) sleep 2
>> +
>> +dnl Check if the right user configured mempool is found for default MTU
>> +(1500) AT_CHECK([grep "Found user configured shared mempool .*
>> suitable
>> +for port with MTU 1500" ovs-vswitchd.log], [], [stdout]) AT_CHECK([grep
>> +"Port p1: Requesting a mempool" ovs-vswitchd.log], [], [stdout])
>> +
>> +dnl Change the MTU value to 7000 to trigger mempool change TMP=$(($(cat
>> +ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1)) AT_CHECK(ovs-vsctl
>> +set Interface p1 mtu_request=7000) OVS_WAIT_UNTIL([tail -n +$TMP
>> +ovs-vswitchd.log | grep "Found user configured shared mempool .*
>> +suitable for port with MTU 7000"]) OVS_WAIT_UNTIL([tail -n +$TMP
>> +ovs-vswitchd.log | grep "Port p1: Requesting a mempool"])
>> +
>> +dnl Change back the MTU value to 1500 to trigger mempool change
>> +(re-use) TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
>> +AT_CHECK(ovs-vsctl set Interface p1 mtu_request=1500)
>> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Found user
>> +configured shared mempool .* suitable for port with MTU 1500"])
>> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Reusing
>> +mempool"])
>> +
>> +dnl Change the MTU value beyond the max value in shared-mempool-
>> config
>> +list TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
>> +AT_CHECK(ovs-vsctl set Interface p1 mtu_request=9000)
>> +OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "No user
>> +configured shared mempool mbuf sizes found suitable for port with MTU
>> +9000"]) OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Port p1:
>> +Requesting a mempool"])
>> +
>> +dnl Clean up
>> +AT_CHECK([ovs-vsctl del-port br10 p1], [], [stdout], [stderr])
>> +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
>> +])")
>>  AT_CLEANUP
>>  dnl --------------------------------------------------------------------------
>> --
>> 2.37.3
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> 
> Hey Sunil,
> I tested your patch with different AVX-512 configurations and NICs and everything looked good to me.
> 
> Tested-by: Michael Phelan <michael.phelan@intel.com>

Applied.  Thanks!

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
index 15f97097a..6b41d6622 100644
--- a/tests/system-dpdk.at
+++ b/tests/system-dpdk.at
@@ -1127,13 +1127,46 @@  OVS_DPDK_PRE_CHECK()
 OVS_DPDK_START_OVSDB()
 OVS_DPDK_START_VSWITCHD()
 
-AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:shared-mempool-config=9000,6000,1500])
+AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:shared-mempool-config=8000,6000,1500])
 AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true])
 
-CHECK_MEMPOOL_PARAM([9000], [ALL], [])
+CHECK_MEMPOOL_PARAM([8000], [ALL], [])
 CHECK_MEMPOOL_PARAM([6000], [ALL], [])
 CHECK_MEMPOOL_PARAM([1500], [ALL], [])
 
-OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
+AT_CHECK(ovs-appctl vlog/set netdev_dpdk:dbg)
+
+dnl Add userspace bridge and a dpdk port
+AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
+AT_CHECK([ovs-vsctl add-port br10 p1 -- set Interface p1 type=dpdk options:dpdk-devargs=net_null0,no-rx=1], [], [stdout], [stderr])
+AT_CHECK([ovs-vsctl show], [], [stdout])
+sleep 2
+
+dnl Check if the right user configured mempool is found for default MTU (1500)
+AT_CHECK([grep "Found user configured shared mempool .* suitable for port with MTU 1500" ovs-vswitchd.log], [], [stdout])
+AT_CHECK([grep "Port p1: Requesting a mempool" ovs-vswitchd.log], [], [stdout])
+
+dnl Change the MTU value to 7000 to trigger mempool change
+TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
+AT_CHECK(ovs-vsctl set Interface p1 mtu_request=7000)
+OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Found user configured shared mempool .* suitable for port with MTU 7000"])
+OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Port p1: Requesting a mempool"])
+
+dnl Change back the MTU value to 1500 to trigger mempool change (re-use)
+TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
+AT_CHECK(ovs-vsctl set Interface p1 mtu_request=1500)
+OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Found user configured shared mempool .* suitable for port with MTU 1500"])
+OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Reusing mempool"])
+
+dnl Change the MTU value beyond the max value in shared-mempool-config list
+TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
+AT_CHECK(ovs-vsctl set Interface p1 mtu_request=9000)
+OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "No user configured shared mempool mbuf sizes found suitable for port with MTU 9000"])
+OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Port p1: Requesting a mempool"])
+
+dnl Clean up
+AT_CHECK([ovs-vsctl del-port br10 p1], [], [stdout], [stderr])
+OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
+])")
 AT_CLEANUP
 dnl --------------------------------------------------------------------------