From: "Tu, Lijuan" <lijuan.tu@intel.com>
To: "Zhao, MeijuanX" <meijuanx.zhao@intel.com>,
"dts@dpdk.org" <dts@dpdk.org>
Cc: "Zhao, MeijuanX" <meijuanx.zhao@intel.com>
Subject: Re: [dts] [PATCH V1 1/2] tests/vf mackfilter: add dpdk pf test scenorio
Date: Wed, 28 Nov 2018 03:25:05 +0000 [thread overview]
Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0B9C1B55@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1542962988-5207-1-git-send-email-meijuanx.zhao@intel.com>
Hi meijun,
Good to see a new function: result_verify_iplink.
I found self.iplinkset only used in result_verify_iplink, so It's better to take iplinkset as a parameter of iplinkset.
For instance:
> + def result_verify_iplink(self, iplinkset=False):
> + if iplinkset == False:
> + self.host_testpmd.execute_cmd('set vf mac addr 0 0 %s' %
> + self.pf0_vf0_mac)
> def test_kernel_2pf_2vf_1vm_iplink_macfilter(self):
> self.setup_2pf_2vf_1vm_env(driver='')
> + self.result_verify_iplink(iplinkset=True)
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhao,meijuan
> Sent: Friday, November 23, 2018 4:50 PM
> To: dts@dpdk.org
> Cc: Zhao, MeijuanX <meijuanx.zhao@intel.com>
> Subject: [dts] [PATCH V1 1/2] tests/vf mackfilter: add dpdk pf test scenorio
>
> add dpdk pf test scenorio
>
> Signed-off-by: zhao,meijuan <meijuanx.zhao@intel.com>
> ---
> tests/TestSuite_vf_macfilter.py | 46 ++++++++++++++++++++++++++-------
> 1 file changed, 36 insertions(+), 10 deletions(-)
>
> diff --git a/tests/TestSuite_vf_macfilter.py b/tests/TestSuite_vf_macfilter.py
> index f0de169..c255d01 100644
> --- a/tests/TestSuite_vf_macfilter.py
> +++ b/tests/TestSuite_vf_macfilter.py
> @@ -13,13 +13,15 @@ VM_CORES_MASK = 'all'
> class TestVfMacFilter(TestCase):
>
> supported_vf_driver = ['pci-stub', 'vfio-pci']
> + vf0_wrongmac = "00:11:22:33:48:55"
> + vf0_setmac = "00:11:22:33:44:55"
>
> def set_up_all(self):
> self.dut_ports = self.dut.get_ports(self.nic)
> self.verify(len(self.dut_ports) > 1, "Insufficient ports")
> self.vm0 = None
> self.pf0_vf0_mac = "00:12:34:56:78:01"
> - self.iplinkset = True
> + self.iplinkset = False
>
> # set vf assign method and vf driver
> self.vf_driver = self.get_suite_cfg()['vf_driver'] @@ -124,15
> +126,18 @@ class TestVfMacFilter(TestCase):
> ###### send the packets with wrong MAC address to VF, check if the VF will
> not RX the packets.
>
> def test_kernel_2pf_2vf_1vm_iplink_macfilter(self):
> -
> + self.iplinkset = True
> self.setup_2pf_2vf_1vm_env(driver='')
> + self.result_verify_iplink()
>
> + def result_verify_iplink(self):
> + if self.iplinkset == False:
> + self.host_testpmd.execute_cmd('set vf mac addr 0 0 %s' %
> + self.pf0_vf0_mac)
> self.vm0_dut_ports = self.vm_dut_0.get_ports('any')
> self.vm0_testpmd = PmdOutput(self.vm_dut_0)
> self.vm0_testpmd.start_testpmd(VM_CORES_MASK)
> # Get VF's MAC
> pmd_vf0_mac = self.vm0_testpmd.get_port_mac(0)
> - vf0_wrongmac = "00:11:22:33:48:55"
> self.vm0_testpmd.execute_cmd('set promisc all off')
> self.vm0_testpmd.execute_cmd('set fwd mac')
> self.vm0_testpmd.execute_cmd('start')
> @@ -147,18 +152,19 @@ class TestVfMacFilter(TestCase):
> src_mac = self.tester.get_mac(tx_port)
> pkt_param=[("ether", {'dst': dst_mac, 'src': src_mac})]
>
> - print "\nfirst send packets to the kernel PF set MAC, expected
> result is RX packets=TX packets\n"
> + print "\nfirst send packets to the PF set MAC, expected result is
> RX packets=TX packets\n"
> result1 = self.tester.check_random_pkts(tgen_ports, pktnum=100,
> allow_miss=False, params=pkt_param)
> print "\nshow port stats in testpmd for double check: \n",
> self.vm0_testpmd.execute_cmd('show port stats all')
> self.verify(result1 != False, "VF0 failed to forward packets to
> VF1")
>
> print "\nSecondly, negative test, send packets to a wrong MAC,
> expected result is RX packets=0\n"
> - dst_mac = vf0_wrongmac
> + dst_mac = self.vf0_wrongmac
> pkt_param=[("ether", {'dst': dst_mac, 'src': src_mac})]
> result2 = self.tester.check_random_pkts(tgen_ports, pktnum=100,
> allow_miss=False, params=pkt_param)
> print "\nshow port stats in testpmd for double check: \n",
> self.vm0_testpmd.execute_cmd('show port stats all')
> self.verify(result2 != True, "VF0 failed to forward packets to VF1")
>
> +
> #######2. test case for kernel pf and dpdk vf 2pf_2vf_1vm MAC filter
> scenario.
> ####### kernel pf will not set MAC address and the VF will get a random
> generated MAC ####### in the testpmd in VM, and then add VF mac
> address in the testpmd,for example, VF_MAC1 @@ -170,17 +176,37 @@
> class TestVfMacFilter(TestCase):
>
> self.iplinkset = False
> self.setup_2pf_2vf_1vm_env(driver='')
> + self.send_packet_and_verify()
> +
> +#######3. test case for dpdk pf and dpdk vf 2pf_2vf_1vm MAC filter
> scenario.
> +####### kernel pf will not set MAC address and the VF will get a random
> +generated MAC ####### in the testpmd in VM, and then add VF mac
> address
> +in the testpmd,for example, VF_MAC1 ####### then send packets to the VF
> +with the random generated MAC and the new added VF_MAC1 #######
> and the
> +expected result is that all packets can be RXed and TXed. What's more, send
> ####### packets with a wrong MAC address to the VF will not received by
> the VF.
> + def test_dpdk_2pf_2vf_1vm_mac_add_filter(self):
> + self.iplinkset = False
> + self.setup_2pf_2vf_1vm_env(driver='igb_uio')
> + self.send_packet_and_verify()
> +
> +######4. test case for dpdk pf and dpdk vf 2pf_2vf_1vm MAC filter
> +scenario ###### dpdk pf will first run 'set vf mac addr 0 0
> +xx:xx:xx:xx:xx:xx, then ###### in the vm, send packets with this MAC to
> +VF, check if the MAC filter works. Also ###### send the packets with wrong
> MAC address to VF, check if the VF will not RX the packets.
> + def test_dpdk_2pf_2vf_1vm_iplink_macfilter(self):
> + self.iplinkset = False
> + self.setup_2pf_2vf_1vm_env(driver='igb_uio')
> + self.result_verify_iplink()
>
> + def send_packet_and_verify(self):
> self.vm0_dut_ports = self.vm_dut_0.get_ports('any')
> self.vm0_testpmd = PmdOutput(self.vm_dut_0)
> self.vm0_testpmd.start_testpmd(VM_CORES_MASK)
>
> # Get VF0 port MAC address
> pmd_vf0_mac = self.vm0_testpmd.get_port_mac(0)
> - vf0_setmac = "00:11:22:33:44:55"
> - vf0_wrongmac = "00:11:22:33:48:55"
> self.vm0_testpmd.execute_cmd('set promisc all off')
> - ret = self.vm0_testpmd.execute_cmd('mac_addr add
> 0 %s' %vf0_setmac)
> + ret = self.vm0_testpmd.execute_cmd('mac_addr add 0 %s'
> + %self.vf0_setmac)
> # check the operation is supported or not.
> print ret
>
> @@ -203,14 +229,14 @@ class TestVfMacFilter(TestCase):
> self.verify(result1 != False, "VF0 failed to forward packets to
> VF1")
>
> print "\nsecondly, send packets to the new added MAC, expected
> result is RX packets=TX packets\n"
> - dst_mac = vf0_setmac
> + dst_mac = self.vf0_setmac
> pkt_param=[("ether", {'dst': dst_mac, 'src': src_mac})]
> result2 = self.tester.check_random_pkts(tgen_ports, pktnum=100,
> allow_miss=False, params=pkt_param)
> print "\nshow port stats in testpmd for double check: \n",
> self.vm0_testpmd.execute_cmd('show port stats all')
> self.verify(result2 != False, "VF0 failed to forward packets to
> VF1")
>
> print "\nThirdly, negative test, send packets to a wrong MAC,
> expected result is RX packets=0\n"
> - dst_mac = vf0_wrongmac
> + dst_mac = self.vf0_wrongmac
> pkt_param=[("ether", {'dst': dst_mac, 'src': src_mac})]
> result3 = self.tester.check_random_pkts(tgen_ports, pktnum=100,
> allow_miss=False, params=pkt_param)
> print "\nshow port stats in testpmd for double check: \n",
> self.vm0_testpmd.execute_cmd('show port stats all')
> --
> 2.17.2
prev parent reply other threads:[~2018-11-28 3:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-23 8:49 zhao,meijuan
2018-11-23 8:49 ` [dts] [PATCH V1 2/2] test_plans/vf pacfilter: " zhao,meijuan
2018-11-28 3:25 ` Tu, Lijuan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8CE3E05A3F976642AAB0F4675D0AD20E0B9C1B55@SHSMSX101.ccr.corp.intel.com \
--to=lijuan.tu@intel.com \
--cc=dts@dpdk.org \
--cc=meijuanx.zhao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).