Message ID | 20220629162406.3352175-1-michael.phelan@intel.com |
---|---|
State | Superseded |
Headers | show |
Series | [ovs-dev,v2] tests: Add OVS-DPDK MTU unit tests. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | fail | github build: failed |
ovsrobot/intel-ovs-compilation | success | test: success |
Hi Mike, Thanks for adding these tests, few comments inline. <snipped> > +dnl > +----------------------------------------------------------------------- > +--- > +dnl MTU increase phy port > +AT_SETUP([OVS-DPDK - MTU increase phy port]) > +AT_KEYWORDS([dpdk]) > + > +OVS_DPDK_PRE_PHY_SKIP() > +OVS_DPDK_START() > + > +dnl First set MTU to its default value and confirm that value, then > +increase the MTU value and confirm the new value > + > +dnl Add userspace bridge and attach it to OVS with default MTU value > +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 show], [], [stdout]) sleep 2 > + > +dnl check default MTU value in the datapath AT_CHECK([ovs-appctl > +dpctl/show], [], [stdout]) AT_CHECK([egrep 'mtu=1500,' stdout], [], > +[stdout]) > + > +dnl increase MTU value and check in the datapath AT_CHECK(ovs-vsctl set > +Interface phy0 mtu_request=9000) To be consistent with the rest of the file, please add "[]" inside AT_CHECK. (Applies to all test cases in the patch) > + > +dnl Fail if MTU is not supported > +AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" > +ovs-vswitchd.log], [], [stdout]) > + > +dnl Fail if error is encountered during MTU setup AT_FAIL_IF([grep > +"Interface phy0 MTU (9000) setup error" ovs-vswitchd.log], [], > +[stdout]) > + > +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) AT_CHECK([egrep > +'mtu=9000,' stdout], [], [stdout]) Do we need to check for the "," above along with mtu=val ? we can probably drop it. [applies to all test cases in the patch] <snipped> > + > +dnl > +----------------------------------------------------------------------- > +--- > +dnl MTU increase vport port > +AT_SETUP([OVS-DPDK - MTU increase vport port]) > +AT_KEYWORDS([dpdk]) > + > +OVS_DPDK_PRE_CHECK() > +OVS_DPDK_START() > + > +dnl Add userspace bridge and attach it to OVS with default MTU value > +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]) AT_CHECK([ovs-vsctl show], [], [stdout]) sleep 2 > + > +dnl check default MTU value in the datapath AT_CHECK([ovs-appctl > +dpctl/show], [], [stdout]) AT_CHECK([egrep 'mtu=1500,' stdout], [], > +[stdout]) > + > +dnl increase MTU value and check in the datapath AT_CHECK(ovs-vsctl set > +Interface dpdkvhostuserclient0 mtu_request=9000) > + > +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) AT_CHECK([egrep > +'mtu=9000,' 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 > +])") > +AT_CLEANUP > +dnl > +----------------------------------------------------------------------- Now that the following commit is merged: 0dd409c2a netdev-dpdk: Delay vhost mempool creation. AFAIK, we would require changing all the vhost related testcases in this patch a bit to configure the mempool, mtu etc by establishing connection with vhost front end (virtio-user) using testpmd first. As an example, for the above test case : "OVS-DPDK - MTU increase vport port" the diff would be like: OVS_DPDK_PRE_CHECK() OVS_DPDK_START() +dnl Find number of sockets +AT_CHECK([lscpu], [], [stdout]) +AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE]) + dnl Add userspace bridge and attach it to OVS with default MTU value 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]) AT_CHECK([ovs-vsctl show], [], [stdout]) sleep 2 +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 Execute testpmd in background +on_exit "pkill -f -x -9 'tail -f /dev/null'" +tail -f /dev/null | dpdk-testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\ + --vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1" \ + --vdev="net_tap0,iface=tap0" --file-prefix page0 \ + --single-file-segments -- -a >$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 & + +OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log]) + dnl check default MTU value in the datapath AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) -AT_CHECK([egrep 'mtu=1500,' stdout], [], [stdout]) +AT_CHECK([egrep 'mtu=1500' stdout], [], [stdout]) dnl increase MTU value and check in the datapath -AT_CHECK(ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9000) +AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9000]) AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) -AT_CHECK([egrep 'mtu=9000,' 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]) +AT_CHECK([egrep 'mtu=9000' stdout], [], [stdout]) dnl Clean up AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr]) Thanks and regards, Sunil
Hi Sunil, Thanks for taking the time to review, I have left some comments inline. > -----Original Message----- > From: Pai G, Sunil <sunil.pai.g@intel.com> > Sent: Saturday 9 July 2022 09:50 > To: Phelan, Michael <michael.phelan@intel.com>; dev@openvswitch.org > Cc: maxime.coquelin@redhat.com; i.maximets@ovn.org > Subject: RE: [ovs-dev] [PATCH v2] tests: Add OVS-DPDK MTU unit tests. > > Hi Mike, > > Thanks for adding these tests, few comments inline. > > <snipped> > > > +dnl > > +--------------------------------------------------------------------- > > +-- > > +--- > > +dnl MTU increase phy port > > +AT_SETUP([OVS-DPDK - MTU increase phy port]) > > +AT_KEYWORDS([dpdk]) > > + > > +OVS_DPDK_PRE_PHY_SKIP() > > +OVS_DPDK_START() > > + > > +dnl First set MTU to its default value and confirm that value, then > > +increase the MTU value and confirm the new value > > + > > +dnl Add userspace bridge and attach it to OVS with default MTU value > > +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 show], [], [stdout]) sleep 2 > > + > > +dnl check default MTU value in the datapath AT_CHECK([ovs-appctl > > +dpctl/show], [], [stdout]) AT_CHECK([egrep 'mtu=1500,' stdout], [], > > +[stdout]) > > + > > +dnl increase MTU value and check in the datapath AT_CHECK(ovs-vsctl > > +set Interface phy0 mtu_request=9000) > > To be consistent with the rest of the file, please add "[]" inside AT_CHECK. > (Applies to all test cases in the patch) Good catch, will change this for the next version. > > > + > > +dnl Fail if MTU is not supported > > +AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" > > +ovs-vswitchd.log], [], [stdout]) > > + > > +dnl Fail if error is encountered during MTU setup AT_FAIL_IF([grep > > +"Interface phy0 MTU (9000) setup error" ovs-vswitchd.log], [], > > +[stdout]) > > + > > +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) AT_CHECK([egrep > > +'mtu=9000,' stdout], [], [stdout]) > > Do we need to check for the "," above along with mtu=val ? we can probably > drop it. [applies to all test cases in the patch] Good point, no need for the ",". I will remove it in the next version. > > <snipped> > > > + > > +dnl > > +--------------------------------------------------------------------- > > +-- > > +--- > > +dnl MTU increase vport port > > +AT_SETUP([OVS-DPDK - MTU increase vport port]) > > +AT_KEYWORDS([dpdk]) > > + > > +OVS_DPDK_PRE_CHECK() > > +OVS_DPDK_START() > > + > > +dnl Add userspace bridge and attach it to OVS with default MTU value > > +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]) AT_CHECK([ovs-vsctl show], [], [stdout]) sleep 2 > > + > > +dnl check default MTU value in the datapath AT_CHECK([ovs-appctl > > +dpctl/show], [], [stdout]) AT_CHECK([egrep 'mtu=1500,' stdout], [], > > +[stdout]) > > + > > +dnl increase MTU value and check in the datapath AT_CHECK(ovs-vsctl > > +set Interface dpdkvhostuserclient0 mtu_request=9000) > > + > > +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) AT_CHECK([egrep > > +'mtu=9000,' 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 > > +])") > > +AT_CLEANUP > > +dnl > > +--------------------------------------------------------------------- > > +-- > > > > Now that the following commit is merged: > > 0dd409c2a netdev-dpdk: Delay vhost mempool creation. > > AFAIK, we would require changing all the vhost related testcases in this patch > a bit to configure the mempool, mtu etc by establishing connection with > vhost front end (virtio-user) using testpmd first. > As an example, for the above test case : "OVS-DPDK - MTU increase vport > port" the diff would be like: Thank you for pointing this out, I will add this change for all the vhost tests in the new version. > > > OVS_DPDK_PRE_CHECK() > OVS_DPDK_START() > > +dnl Find number of sockets > +AT_CHECK([lscpu], [], [stdout]) > +AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while > +(c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE]) > + > dnl Add userspace bridge and attach it to OVS with default MTU value > 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]) > AT_CHECK([ovs-vsctl show], [], [stdout]) sleep 2 > > +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 Execute testpmd in background > +on_exit "pkill -f -x -9 'tail -f /dev/null'" > +tail -f /dev/null | dpdk-testpmd --socket-mem="$(cat NUMA_NODE)" --no- > pci\ > + -- > vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1" \ > + --vdev="net_tap0,iface=tap0" --file-prefix page0 \ > + --single-file-segments -- -a > +>$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 & > + > +OVS_WAIT_UNTIL([grep "virtio is now ready for processing" > +ovs-vswitchd.log]) > + > dnl check default MTU value in the datapath AT_CHECK([ovs-appctl > dpctl/show], [], [stdout]) -AT_CHECK([egrep 'mtu=1500,' stdout], [], > [stdout]) > +AT_CHECK([egrep 'mtu=1500' stdout], [], [stdout]) > > dnl increase MTU value and check in the datapath -AT_CHECK(ovs-vsctl set > Interface dpdkvhostuserclient0 mtu_request=9000) > +AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 > +mtu_request=9000]) > > AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) -AT_CHECK([egrep > 'mtu=9000,' 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]) > +AT_CHECK([egrep 'mtu=9000' stdout], [], [stdout]) > > dnl Clean up > AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], > [stderr]) > > > Thanks and regards, > Sunil Kind regards, Michael.
diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at index b036580de..d9a5fc1c3 100644 --- a/tests/system-dpdk.at +++ b/tests/system-dpdk.at @@ -384,6 +384,334 @@ dnl -------------------------------------------------------------------------- +dnl -------------------------------------------------------------------------- +dnl MTU increase phy port +AT_SETUP([OVS-DPDK - MTU increase phy port]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_PHY_SKIP() +OVS_DPDK_START() + +dnl First set MTU to its default value and confirm that value, then increase the MTU value and confirm the new value + +dnl Add userspace bridge and attach it to OVS with default MTU value +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 show], [], [stdout]) +sleep 2 + +dnl check default MTU value in the datapath +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=1500,' stdout], [], [stdout]) + +dnl increase MTU value and check in the datapath +AT_CHECK(ovs-vsctl set Interface phy0 mtu_request=9000) + +dnl Fail if MTU is not supported +AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout]) + +dnl Fail if error is encountered during MTU setup +AT_FAIL_IF([grep "Interface phy0 MTU (9000) setup error" ovs-vswitchd.log], [], [stdout]) + +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=9000,' stdout], [], [stdout]) + + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr]) +OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl MTU decrease phy port +AT_SETUP([OVS-DPDK - MTU decrease phy port]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_PHY_SKIP() +OVS_DPDK_START() + +dnl First set an increased MTU value and confirm that value, then decrease the MTU value and confirm the new value + +dnl Add userspace bridge and attach it to OVS and modify MTU value +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 mtu_request=9000) +AT_CHECK([ovs-vsctl show], [], [stdout]) +sleep 2 + +dnl Fail if MTU is not supported +AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout]) + +dnl Fail if error is encountered during MTU setup +AT_FAIL_IF([grep "Interface phy0 MTU (9000) setup error" ovs-vswitchd.log], [], [stdout]) + +dnl check MTU value in the datapath +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=9000,' stdout], [], [stdout]) + +dnl decrease MTU value and check in the datapath +AT_CHECK(ovs-vsctl set Interface phy0 mtu_request=2000) + +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=2000,' stdout], [], [stdout]) + + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr]) +OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl MTU increase vport port +AT_SETUP([OVS-DPDK - MTU increase vport port]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_CHECK() +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS with default MTU value +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]) +AT_CHECK([ovs-vsctl show], [], [stdout]) +sleep 2 + +dnl check default MTU value in the datapath +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=1500,' stdout], [], [stdout]) + +dnl increase MTU value and check in the datapath +AT_CHECK(ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9000) + +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=9000,' 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 +])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl MTU decrease vport port +AT_SETUP([OVS-DPDK - MTU decrease vport port]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_CHECK() +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS and modify MTU value +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]) +AT_CHECK(ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9000) +AT_CHECK([ovs-vsctl show], [], [stdout]) +sleep 2 + +dnl check MTU value in the datapath +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=9000,' stdout], [], [stdout]) + +dnl decrease MTU value and check in the datapath +AT_CHECK(ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=2000) + +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=2000,' 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 +])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl MTU upper bound phy port +AT_SETUP([OVS-DPDK - MTU upper bound phy port]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_PHY_SKIP() +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS and set MTU value to max upper bound +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 mtu_request=9702) +AT_CHECK([ovs-vsctl show], [], [stdout]) +sleep 2 + +dnl Fail if MTU is not supported +AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout]) + +dnl Fail if error is encountered during MTU setup +AT_FAIL_IF([grep "Interface phy0 MTU (9702) setup error" ovs-vswitchd.log], [], [stdout]) + +dnl check MTU value in the datapath +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=9702,' stdout], [], [stdout]) + +dnl set MTU value above upper bound and check for error +AT_CHECK(ovs-vsctl set Interface phy0 mtu_request=9711) +AT_CHECK([grep "phy0: unsupported MTU 9711" ovs-vswitchd.log], [], [stdout]) + + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr]) +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [ +\@phy0: unsupported MTU 9711@d +\@failed to set MTU for network device phy0: Invalid argument@d +])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl MTU lower bound phy port +AT_SETUP([OVS-DPDK - MTU lower bound phy port]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_PHY_SKIP() +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS and set MTU value to min lower bound +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 mtu_request=68) +AT_CHECK([ovs-vsctl show], [], [stdout]) +sleep 2 + +dnl Fail if MTU is not supported +AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout]) + +dnl Fail if error is encountered during MTU setup +AT_FAIL_IF([grep "Interface phy0 MTU (68) setup error" ovs-vswitchd.log], [], [stdout]) + +dnl check MTU value in the datapath +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=68,' stdout], [], [stdout]) + +dnl set MTU value below lower bound and check for error +AT_CHECK(ovs-vsctl set Interface phy0 mtu_request=67) +AT_CHECK([grep "phy0: unsupported MTU 67" ovs-vswitchd.log], [], [stdout]) + + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr]) +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [ +\@phy0: unsupported MTU 67@d +\@failed to set MTU for network device phy0: Invalid argument@d +])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl MTU upper bound vport port +AT_SETUP([OVS-DPDK - MTU upper bound vport port]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_CHECK() +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS and set MTU value to max upper bound +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]) +AT_CHECK(ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9702) +AT_CHECK([ovs-vsctl show], [], [stdout]) +sleep 2 + +dnl check MTU value in the datapath +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=9702,' stdout], [], [stdout]) + +dnl set MTU value above upper bound and check for error +AT_CHECK(ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9711) +AT_CHECK([grep "dpdkvhostuserclient0: unsupported MTU 9711" ovs-vswitchd.log], [], [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 +\@dpdkvhostuserclient0: unsupported MTU 9711@d +\@failed to set MTU for network device dpdkvhostuserclient0: Invalid argument@d +])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl MTU lower bound vport port +AT_SETUP([OVS-DPDK - MTU lower bound vport port]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_CHECK() +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS and set MTU value to min lower bound +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]) +AT_CHECK(ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=68) +AT_CHECK([ovs-vsctl show], [], [stdout]) +sleep 2 + +dnl check MTU value in the datapath +AT_CHECK([ovs-appctl dpctl/show], [], [stdout]) +AT_CHECK([egrep 'mtu=68,' stdout], [], [stdout]) + +dnl set MTU value below lower bound and check for error +AT_CHECK(ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=67) +AT_CHECK([grep "dpdkvhostuserclient0: unsupported MTU 67" ovs-vswitchd.log], [], [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 +\@dpdkvhostuserclient0: unsupported MTU 67@d +\@failed to set MTU for network device dpdkvhostuserclient0: Invalid argument@d +])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + dnl -------------------------------------------------------------------------- dnl Add standard DPDK PHY port AT_SETUP([OVS-DPDK - MFEX Autovalidator])
This adds 8 new unit tests to the 'check-dpdk' subsystem that will test Maximum Transmission Unit (MTU) functionality. Signed-off-by: Michael Phelan <michael.phelan@intel.com> --- v2: - Removed DB checks when confirming MTU value in all tests. - Added checks to catch errors in MTU setup or if device does not support MTU configuration. - Fixed typo in comments. --- --- tests/system-dpdk.at | 328 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 328 insertions(+)