> -----Original Message-----
> From: Stokes, Ian <[email protected]>
> Sent: Tuesday 28 June 2022 15:46
> To: Phelan, Michael <[email protected]>; [email protected]
> Cc: [email protected]; [email protected]; [email protected]
> Subject: RE: [PATCH] tests: Add OVS-DPDK QoS unit tests
>
>
>
> > -----Original Message-----
> > From: Phelan, Michael <[email protected]>
> > Sent: Tuesday, June 21, 2022 11:19 AM
> > To: [email protected]
> > Cc: Stokes, Ian <[email protected]>; [email protected];
> > [email protected]; [email protected]; Phelan, Michael
> > <[email protected]>
> > Subject: [PATCH] tests: Add OVS-DPDK QoS unit tests
> >
> > This adds 4 new unit tests to the 'check-dpdk' subsystem that will
> > test Quality of Service (QoS) functionality.
> >
>
> Hi Michael,
>
> This is quite similar to the rate limiting patch but there are a few comments
> here
> that needs addressing.
>
>
> > Signed-off-by: Michael Phelan <[email protected]>
> > ---
> > tests/system-dpdk.at | 141
> > +++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 141 insertions(+)
> >
> > diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at index
> > 7d2715c4a..90e85e8a9 100644
> > --- a/tests/system-dpdk.at
> > +++ b/tests/system-dpdk.at
> > @@ -222,6 +222,147 @@ OVS_VSWITCHD_STOP("m4_join([],
> > [SYSTEM_DPDK_ALLOWED_LOGS], [ AT_CLEANUP dnl
> > ----------------------------------------------------------------------
> > ----
> >
> > +
> > +
> > +dnl
> > +---------------------------------------------------------------------
> > +-----
> > +dnl QoS create delete phy port
> > +AT_SETUP([OVS-DPDK - QoS 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 egress 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])
> > +OVS_WAIT_UNTIL([ovs-vsctl set port phy0 qos=@newqos -- --id=@newqos
> > create qos type=egress-policer other-config:cir=1250000 other-
> > config:cbs=2048])
> > +AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show phy0], [], [stdout])
> > +sleep 2
> > +
> > +dnl Fail if policer could not be created AT_FAIL_IF([grep "Could not
> > +create rte meter for egress policer" ovs-
> > vswitchd.log], [], [stdout])
> > +
> > +dnl remove egress policer
> > +AT_CHECK([ovs-vsctl destroy QoS phy0 -- clear Port phy0 qos])
> > +
> > +dnl Clean up
> > +AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
> > +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
> > +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0:
> > No such file or directory@d
>
> I don't see the need for this above, as it's a phy test there is no vhost
> user port
> being created so this error should not occur.
You're right, that is there unnecessarily, I will remove it for the next
version.
>
> > +])")
> > +AT_CLEANUP
> > +dnl
> > +---------------------------------------------------------------------
> > +-----
> > +
> > +
> > +
> > +dnl
> > +---------------------------------------------------------------------
> > +-----
> > +dnl QoS create delete vport port
> > +AT_SETUP([OVS-DPDK - QoS create delete vport port])
> > +AT_KEYWORDS([dpdk])
> > +
> > +OVS_DPDK_PRE_CHECK()
> > +OVS_DPDK_START()
> > +
> > +dnl Add userspace bridge and attach it to OVS and add egress policer
> > +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10
> > datapath_type=netdev])
> > +AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set
> > +Interface
> > dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-
> > path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
> > +OVS_WAIT_UNTIL([ovs-vsctl set port dpdkvhostuserclient0 qos=@newqos
> > -- --id=@newqos create qos type=egress-policer
> > other-config:cir=1250000 \
> > + other-config:cbs=2048]) AT_CHECK([ovs-appctl -t
> > +ovs-vswitchd qos/show dpdkvhostuserclient0], [],
> > [stdout])
> > +sleep 2
> > +
> > +dnl Fail if policer could not be created
>
> Would be better to specify here (and in the comments of the other tests) that
> it
> is an egress policer that could not be created.
Agreed, I will update the comments for the next version.
Thanks,
Michael.
>
> Thanks
> Ian
>
> > +AT_FAIL_IF([grep "Could not create rte meter for egress policer" ovs-
> > vswitchd.log], [], [stdout])
> > +
> > +dnl remove egress policer
> > +AT_CHECK([ovs-vsctl destroy QoS dpdkvhostuserclient0 -- clear Port
> > dpdkvhostuserclient0 qos])
> > +
> > +dnl Parse log file
> > +AT_CHECK([grep "VHOST_CONFIG: vhost-user client: socket created" ovs-
> > vswitchd.log], [], [stdout])
> > +AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in
> > 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
> > +AT_CHECK([grep "VHOST_CONFIG: $OVS_RUNDIR/dpdkvhostclient0:
> > reconnecting..." ovs-vswitchd.log], [], [stdout])
> > +
> > +dnl Clean up
> > +AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [],
> > +[stdout],
> > [stderr])
> > +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
> > +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0:
> > No such file or directory@d
> > +])")
> > +AT_CLEANUP
> > +dnl
> > +---------------------------------------------------------------------
> > +-----
> > +
> > +
> > +
> > +dnl
> > +---------------------------------------------------------------------
> > +-----
> > +dnl QoS no cir
> > +AT_SETUP([OVS-DPDK - QoS no cir])
> > +AT_KEYWORDS([dpdk])
> > +
> > +OVS_DPDK_PRE_CHECK()
> > +OVS_DPDK_START()
> > +
> > +dnl Add userspace bridge and attach it to OVS and add egress policer
> > +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10
> > datapath_type=netdev])
> > +AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set
> > +Interface
> > dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-
> > path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
> > +OVS_WAIT_UNTIL([ovs-vsctl set port dpdkvhostuserclient0 qos=@newqos
> > -- --id=@newqos create qos type=egress-policer other-config:cbs=2048])
> > +sleep 2
> > +
> > +dnl check policer was not created
> > +AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show dpdkvhostuserclient0],
> > +[],
> > [stdout])
> > +AT_CHECK([egrep 'QoS not configured on dpdkvhostuserclient0' stdout],
> > [], [stdout])
> > +
> > +dnl Parse log file
> > +AT_CHECK([grep "VHOST_CONFIG: vhost-user client: socket created" ovs-
> > vswitchd.log], [], [stdout])
> > +AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in
> > 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
> > +AT_CHECK([grep "VHOST_CONFIG: $OVS_RUNDIR/dpdkvhostclient0:
> > reconnecting..." ovs-vswitchd.log], [], [stdout])
> > +
> > +dnl Clean up
> > +AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [],
> > +[stdout],
> > [stderr])
> > +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
> > +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0:
> > No such file or directory@d
> > +\@Could not create rte meter for egress policer@d \@Failed to set QoS
> > +type egress-policer on port dpdkvhostuserclient0:
> > Invalid argument@d
> > +])")
> > +AT_CLEANUP
> > +dnl
> > +---------------------------------------------------------------------
> > +-----
> > +
> > +
> > +
> > +dnl
> > +---------------------------------------------------------------------
> > +-----
> > +dnl QoS no cbs
> > +AT_SETUP([OVS-DPDK - QoS no cbs])
> > +AT_KEYWORDS([dpdk])
> > +
> > +OVS_DPDK_PRE_CHECK()
> > +OVS_DPDK_START()
> > +
> > +dnl Add userspace bridge and attach it to OVS and add egress policer
> > +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10
> > datapath_type=netdev])
> > +AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set
> > +Interface
> > dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-
> > path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
> > +OVS_WAIT_UNTIL([ovs-vsctl set port dpdkvhostuserclient0 qos=@newqos
> > -- --id=@newqos create qos type=egress-policer
> > other-config:cir=1250000])
> > +sleep 2
> > +
> > +dnl check policer was not created
> > +AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show dpdkvhostuserclient0],
> > +[],
> > [stdout])
> > +AT_CHECK([egrep 'QoS not configured on dpdkvhostuserclient0' stdout],
> > [], [stdout])
> > +
> > +
> > +dnl Parse log file
> > +AT_CHECK([grep "VHOST_CONFIG: vhost-user client: socket created" ovs-
> > vswitchd.log], [], [stdout])
> > +AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in
> > 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
> > +AT_CHECK([grep "VHOST_CONFIG: $OVS_RUNDIR/dpdkvhostclient0:
> > reconnecting..." ovs-vswitchd.log], [], [stdout])
> > +
> > +dnl Clean up
> > +AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [],
> > +[stdout],
> > [stderr])
> > +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
> > +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0:
> > No such file or directory@d
> > +\@Could not create rte meter for egress policer@d \@Failed to set QoS
> > +type egress-policer on port dpdkvhostuserclient0:
> > Invalid argument@d
> > +])")
> > +AT_CLEANUP
> > +dnl
> > +---------------------------------------------------------------------
> > +-----
> > +
> > +
> > +
> > dnl
> > ----------------------------------------------------------------------
> > ----
> > dnl Add standard DPDK PHY port
> > AT_SETUP([OVS-DPDK - MFEX Autovalidator])
> > --
> > 2.25.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev