On 4/28/22 16:56, Michael Phelan wrote:
> From: Seamus Ryan <[email protected]>
>
> This adds 4 new unit tests to the 'check-dpdk' subsystem that will
> test rate limiting functionality.
>
> Signed-off-by: Seamus Ryan <[email protected]>
> Signed-off-by: Michael Phelan <[email protected]>
> Co-authored-by: Michael Phelan <[email protected]>
>
> ---
> v2:
> - Fixed dn1 typo & spacing issues.
> - Added check for removing burst and rate values.
> - Renamed tests to specify ingress policing.
> ---
> NEWS | 2 +
> tests/system-dpdk.at | 161 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 163 insertions(+)
>
> diff --git a/NEWS b/NEWS
> index 5bc8e6566..63c6a3009 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -19,6 +19,8 @@ Post-v2.17.0
> - OVSDB:
> * 'relay' service model now supports transaction history, i.e. honors
> the
> 'last-txn-id' field in 'monitor_cond_since' requests from clients.
> + - DPDK:
> + * Add rate limiting unit tests to DPDK testsuite.
This is not a change visible to an end user and not a big
architectural change, so no need for a NEWS entry.
>
>
> v2.17.0 - 17 Feb 2022
> diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
> index 7d2715c4a..74174f61e 100644
> --- a/tests/system-dpdk.at
> +++ b/tests/system-dpdk.at
> @@ -222,6 +222,167 @@ OVS_VSWITCHD_STOP("m4_join([],
> [SYSTEM_DPDK_ALLOWED_LOGS], [
> AT_CLEANUP
> dnl
> --------------------------------------------------------------------------
>
> +
> +
> +dnl
> --------------------------------------------------------------------------
> +dnl Ingress policing create delete phy port
> +AT_SETUP([OVS-DPDK - Ingress policing create delete phy port])
> +AT_KEYWORDS([dpdk])
> +
> +OVS_DPDK_PRE_PHY_SKIP()
> +OVS_DPDK_START()
> +
> +dnl Add userspace bridge and attach it to OVS and add policer
> +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
> +AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk
> options:dpdk-devargs=$(cat PCI_ADDR)], [], [stdout], [stderr])
> +AT_CHECK([ovs-vsctl set interface phy0 ingress_policing_rate=10000
> ingress_policing_burst=1000])
> +AT_CHECK([ovs-vsctl show], [], [stdout])
> +sleep 2
> +
> +dnl check policer was created correctly
> +AT_CHECK([ovs-vsctl list interface phy0], [], [stdout])
> +AT_CHECK([egrep 'ingress_policing_burst: 1000' stdout], [], [stdout])
> +
> +AT_CHECK([ovs-vsctl list interface phy0], [], [stdout])
> +AT_CHECK([egrep 'ingress_policing_rate: 10000' stdout], [], [stdout])
> +
> +dnl remove policer
> +AT_CHECK([ovs-vsctl set interface phy0 ingress_policing_rate=0
> ingress_policing_burst=0])
> +
> +dnl check policer was removed correctly
> +AT_CHECK([ovs-vsctl list interface phy0], [], [stdout])
> +AT_CHECK([egrep 'ingress_policing_burst: 0' stdout], [], [stdout])
> +
> +AT_CHECK([ovs-vsctl list interface phy0], [], [stdout])
> +AT_CHECK([egrep 'ingress_policing_rate: 0' stdout], [], [stdout])
> +
> +dnl Clean up
> +AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
> +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [])")
> +AT_CLEANUP
I didn't try to play with these tests, so I'm curious how certain
you're that these tests will catch configuration problems for
the policer?
Database read-write is mostly independent from the implementation
and AFAICT the configuration failure will not be propagated to
the database, so I'm not sure if we need to read those values back.
tests/ovs-vsctl.at already includes database tests for the policer.
We can keep reads here, but only for consistency, I guess. They
doesn't seem to have a lot of test value by themselves.
The only issue that these tests should be able to catch is the
ERR log "Could not create rte meter for ingress policer". Tests
are not checking for it directly, but relying on the ovs-vswitch.log
to not have any errors at the end of the test. That might be
fine, but maybe we need to be more clear about that in the test
comments as we have no real way right now to tell if the policer
was actually created or removed.
What do you think?
Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev