From: "Liu, Yong" <yong.liu@intel.com>
To: "Han, YingyaX" <yingyax.han@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Han, YingyaX" <yingyax.han@intel.com>
Subject: Re: [dts] [PATCH V1]tests/mac_filter: fix FVL stats issue
Date: Tue, 27 Mar 2018 08:55:51 +0000 [thread overview]
Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62FCB6F4@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1521520849-89149-1-git-send-email-yingyax.han@intel.com>
Yingya,
Some comments are inline.
Thanks,
Marvin
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of han,yingya
> Sent: Tuesday, March 20, 2018 12:41 PM
> To: dts@dpdk.org
> Cc: Han, YingyaX <yingyax.han@intel.com>
> Subject: [dts] [PATCH V1]tests/mac_filter: fix FVL stats issue
>
> In testpmd show port stats command is to read FVL register, and it's all
> packets of FVL.
> Contrast to FLV , Niantic's stats, tx/rx packets , don't include packets
> filtered.
> It's a difference between Niantic and FLV.
> Signed-off-by: han,yingya <yingyax.han@intel.com>
> ---
> tests/TestSuite_mac_filter.py | 35 ++++++++++++++++-------------------
> 1 file changed, 16 insertions(+), 19 deletions(-)
>
> diff --git a/tests/TestSuite_mac_filter.py b/tests/TestSuite_mac_filter.py
> index 1c58b87..a0c890d 100644
> --- a/tests/TestSuite_mac_filter.py
> +++ b/tests/TestSuite_mac_filter.py
> @@ -107,48 +107,45 @@ class TestWhitelist(TestCase):
>
> # send one packet with the portid MAC address
> self.whitelist_send_packet(portid, self.dest)
> - out = self.dut.send_expect("show port stats %d" % portid,
> "testpmd> ")
> - cur_rxpkt = utils.regexp(out, "RX-packets: ([0-9]+)")
> + out = self.dut.get_session_output()
> + cur_rxpkt = utils.regexp(out, "received ([0-9]+) packets")
Checking packet number by Rx only verbose output is one alternative way to get receive number of packets.
You'd better add some comments about why here not use "port stats".
> # check the packet increase
> self.verify(int(cur_rxpkt) == int(pre_rxpkt) +
> self.frames_to_send,
> "Packet has not been received on default address")
> # send one packet to a different MAC address
> # new_mac = self.dut.get_mac_address(portid)
> self.whitelist_send_packet(portid, fake_mac_addr)
> -
> + out = self.dut.get_session_output()
> pre_rxpkt = cur_rxpkt
> - out = self.dut.send_expect("show port stats %d" % portid,
> "testpmd> ")
> - cur_rxpkt = utils.regexp(out, "RX-packets: ([0-9]+)")
> -
> - # check the packet DO NOT increase
> - self.verify(int(cur_rxpkt) == int(pre_rxpkt),
> + if not out:
> + cur_rxpkt = 0
> + # check the packet DO NOT increase
> + self.verify(int(cur_rxpkt) == int(pre_rxpkt) -
> self.frames_to_send,
> "Packet has been received on a new MAC address that
> has not been added yet")
I think here just need to check no packet is arrived. Only need to check no "received" message in output is enough.
> # add the different MAC address
> - out = self.dut.send_expect("mac_addr add %d" % portid + " %s" %
> fake_mac_addr, "testpmd>")
> + self.dut.send_expect("mac_addr add %d" % portid + " %s" %
> fake_mac_addr, "testpmd>")
>
> # send again one packet to a different MAC address
> self.whitelist_send_packet(portid, fake_mac_addr)
> -
> + out = self.dut.get_session_output()
> pre_rxpkt = cur_rxpkt
> - out = self.dut.send_expect("show port stats %d" % portid,
> "testpmd> ")
> - cur_rxpkt = utils.regexp(out, "RX-packets: ([0-9]+)")
> + cur_rxpkt = utils.regexp(out, "received ([0-9]+) packets")
>
> # check the packet increase
> self.verify(int(cur_rxpkt) == int(pre_rxpkt) +
> self.frames_to_send,
> "Packet has not been received on a new MAC address
> that has been added to the port")
>
> # remove the fake MAC address
> - out = self.dut.send_expect("mac_addr remove %d" % portid + " %s" %
> fake_mac_addr, "testpmd>")
> + self.dut.send_expect("mac_addr remove %d" % portid + " %s" %
> fake_mac_addr, "testpmd>")
>
> # send again one packet to a different MAC address
> self.whitelist_send_packet(portid, fake_mac_addr)
> -
> + out = self.dut.get_session_output()
> pre_rxpkt = cur_rxpkt
> - out = self.dut.send_expect("show port stats %d" % portid,
> "testpmd> ")
> - cur_rxpkt = utils.regexp(out, "RX-packets: ([0-9]+)")
> -
> - # check the packet increase
> - self.verify(int(cur_rxpkt) == int(pre_rxpkt),
> + if not out:
> + cur_rxpkt = 0
> + # check the packet increase
> + self.verify(int(cur_rxpkt) == int(pre_rxpkt) -
> self.frames_to_send,
Same comment as previous one.
> "Packet has been received on a new MAC address that
> has been removed from the port")
> self.dut.send_expect("stop", "testpmd> ")
>
> --
> 1.9.3
next prev parent reply other threads:[~2018-03-27 8:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-20 4:40 han,yingya
2018-03-27 8:55 ` Liu, Yong [this message]
2018-03-28 6:38 ` Han, YingyaX
2018-03-28 6:33 han,yingya
2018-03-29 10:53 ` Liu, Yong
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=86228AFD5BCD8E4EBFD2B90117B5E81E62FCB6F4@SHSMSX103.ccr.corp.intel.com \
--to=yong.liu@intel.com \
--cc=dts@dpdk.org \
--cc=yingyax.han@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).