test suite reviews and discussions
 help / color / Atom feed
* [dts] [PATCH V1] tests/vhost_pmd_xstats: fix issue about send pkt
@ 2019-08-26 23:50 lihong
  2019-08-27  8:34 ` Wang, Yinan
  2019-09-04  5:09 ` Tu, Lijuan
  0 siblings, 2 replies; 3+ messages in thread
From: lihong @ 2019-08-26 23:50 UTC (permalink / raw)
  To: dts; +Cc: lihong

1. remove useless import
2. add mtu set when the pkt size greater then 1518

Signed-off-by: lihong <lihongx.ma@intel.com>
---
 tests/TestSuite_vhost_pmd_xstats.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/TestSuite_vhost_pmd_xstats.py b/tests/TestSuite_vhost_pmd_xstats.py
index 75b87a6..82dcc4b 100755
--- a/tests/TestSuite_vhost_pmd_xstats.py
+++ b/tests/TestSuite_vhost_pmd_xstats.py
@@ -34,20 +34,17 @@ DPDK Test suite.
 
 vhost pmd xstats test suite.
 """
-import os
-import string
 import re
 import time
 import utils
 import datetime
 import copy
 from test_case import TestCase
-from exception import VerifyFailure
 from settings import HEADER_SIZE
-from etgen import IxiaPacketGenerator
 from qemu_kvm import QEMUKvm
 from packet import Packet
-
+ETHER_JUMBO_FRAME_MTU = 9000
+DEFAULT_JUMBO_FRAME_MTU = 1500
 
 class TestVhostPmdXstats(TestCase):
 
@@ -61,6 +58,8 @@ class TestVhostPmdXstats(TestCase):
         self.dut.unbind_interfaces_linux(self.unbind_ports)
         cores = self.dut.get_core_list("1S/4C/1T")
         self.coremask = utils.create_mask(cores)
+        txport = self.tester.get_local_port(self.dut_ports[0])
+        self.txItf = self.tester.get_interface(txport)
 
         self.scapy_num = 0
         self.dmac = self.dut.get_mac_address(self.dut_ports[0])
@@ -124,8 +123,6 @@ class TestVhostPmdXstats(TestCase):
         Send a packet to port
         """
         self.scapy_num += 1
-        txport = self.tester.get_local_port(self.dut_ports[0])
-        self.txItf = self.tester.get_interface(txport)
         pkt = Packet(pkt_type='TCP', pkt_len=pktsize)
         pkt.config_layer('ether', {'dst': dmac, })
         pkt.send_pkt(tx_port=self.txItf, count=num)
@@ -166,10 +163,13 @@ class TestVhostPmdXstats(TestCase):
         for cat in categories:
             scope = re.search(r'(?<=rx_)\w+(?=_packets)', cat).group(0)
             pktsize = int(re.search(r'(?<=rx_size_)\d+', cat).group(0))
+            if pktsize > 1518:
+                self.tester.send_expect('ifconfig %s mtu %d' % (self.txItf, ETHER_JUMBO_FRAME_MTU), '# ')
 
             self.scapy_send_packet(pktsize, self.dmac, 10000)
             self.send_verify(scope, 10000)
             self.clear_port_xstats(scope)
+        self.tester.send_expect('ifconfig %s mtu %d' % (self.txItf, DEFAULT_JUMBO_FRAME_MTU), '# ')
 
     def clear_port_xstats(self, scope):
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dts] [PATCH V1] tests/vhost_pmd_xstats: fix issue about send pkt
  2019-08-26 23:50 [dts] [PATCH V1] tests/vhost_pmd_xstats: fix issue about send pkt lihong
@ 2019-08-27  8:34 ` Wang, Yinan
  2019-09-04  5:09 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Wang, Yinan @ 2019-08-27  8:34 UTC (permalink / raw)
  To: Ma, LihongX, dts; +Cc: Ma, LihongX

Acked-by: Wang, Yinan <yinan.wang@intel.com>

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong
> Sent: 2019^[$BG/^[(B8^[$B7n^[(B27^[$BF|^[(B 7:51
> To: dts@dpdk.org
> Cc: Ma, LihongX <lihongx.ma@intel.com>
> Subject: [dts] [PATCH V1] tests/vhost_pmd_xstats: fix issue about send pkt
> 
> 1. remove useless import
> 2. add mtu set when the pkt size greater then 1518
> 
> Signed-off-by: lihong <lihongx.ma@intel.com>
> ---
>  tests/TestSuite_vhost_pmd_xstats.py | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/TestSuite_vhost_pmd_xstats.py
> b/tests/TestSuite_vhost_pmd_xstats.py
> index 75b87a6..82dcc4b 100755
> --- a/tests/TestSuite_vhost_pmd_xstats.py
> +++ b/tests/TestSuite_vhost_pmd_xstats.py
> @@ -34,20 +34,17 @@ DPDK Test suite.
> 
>  vhost pmd xstats test suite.
>  """
> -import os
> -import string
>  import re
>  import time
>  import utils
>  import datetime
>  import copy
>  from test_case import TestCase
> -from exception import VerifyFailure
>  from settings import HEADER_SIZE
> -from etgen import IxiaPacketGenerator
>  from qemu_kvm import QEMUKvm
>  from packet import Packet
> -
> +ETHER_JUMBO_FRAME_MTU = 9000
> +DEFAULT_JUMBO_FRAME_MTU = 1500
> 
>  class TestVhostPmdXstats(TestCase):
> 
> @@ -61,6 +58,8 @@ class TestVhostPmdXstats(TestCase):
>          self.dut.unbind_interfaces_linux(self.unbind_ports)
>          cores = self.dut.get_core_list("1S/4C/1T")
>          self.coremask = utils.create_mask(cores)
> +        txport = self.tester.get_local_port(self.dut_ports[0])
> +        self.txItf = self.tester.get_interface(txport)
> 
>          self.scapy_num = 0
>          self.dmac = self.dut.get_mac_address(self.dut_ports[0])
> @@ -124,8 +123,6 @@ class TestVhostPmdXstats(TestCase):
>          Send a packet to port
>          """
>          self.scapy_num += 1
> -        txport = self.tester.get_local_port(self.dut_ports[0])
> -        self.txItf = self.tester.get_interface(txport)
>          pkt = Packet(pkt_type='TCP', pkt_len=pktsize)
>          pkt.config_layer('ether', {'dst': dmac, })
>          pkt.send_pkt(tx_port=self.txItf, count=num) @@ -166,10 +163,13 @@
> class TestVhostPmdXstats(TestCase):
>          for cat in categories:
>              scope = re.search(r'(?<=rx_)\w+(?=_packets)', cat).group(0)
>              pktsize = int(re.search(r'(?<=rx_size_)\d+', cat).group(0))
> +            if pktsize > 1518:
> +                self.tester.send_expect('ifconfig %s mtu %d' %
> + (self.txItf, ETHER_JUMBO_FRAME_MTU), '# ')
> 
>              self.scapy_send_packet(pktsize, self.dmac, 10000)
>              self.send_verify(scope, 10000)
>              self.clear_port_xstats(scope)
> +        self.tester.send_expect('ifconfig %s mtu %d' % (self.txItf,
> + DEFAULT_JUMBO_FRAME_MTU), '# ')
> 
>      def clear_port_xstats(self, scope):
> 
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dts] [PATCH V1] tests/vhost_pmd_xstats: fix issue about send pkt
  2019-08-26 23:50 [dts] [PATCH V1] tests/vhost_pmd_xstats: fix issue about send pkt lihong
  2019-08-27  8:34 ` Wang, Yinan
@ 2019-09-04  5:09 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2019-09-04  5:09 UTC (permalink / raw)
  To: Ma, LihongX, dts; +Cc: Ma, LihongX

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong
> Sent: Tuesday, August 27, 2019 7:51 AM
> To: dts@dpdk.org
> Cc: Ma, LihongX <lihongx.ma@intel.com>
> Subject: [dts] [PATCH V1] tests/vhost_pmd_xstats: fix issue about send pkt
> 
> 1. remove useless import
> 2. add mtu set when the pkt size greater then 1518
> 
> Signed-off-by: lihong <lihongx.ma@intel.com>
> ---
>  tests/TestSuite_vhost_pmd_xstats.py | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/TestSuite_vhost_pmd_xstats.py
> b/tests/TestSuite_vhost_pmd_xstats.py
> index 75b87a6..82dcc4b 100755
> --- a/tests/TestSuite_vhost_pmd_xstats.py
> +++ b/tests/TestSuite_vhost_pmd_xstats.py
> @@ -34,20 +34,17 @@ DPDK Test suite.
> 
>  vhost pmd xstats test suite.
>  """
> -import os
> -import string
>  import re
>  import time
>  import utils
>  import datetime
>  import copy
>  from test_case import TestCase
> -from exception import VerifyFailure
>  from settings import HEADER_SIZE
> -from etgen import IxiaPacketGenerator
>  from qemu_kvm import QEMUKvm
>  from packet import Packet
> -
> +ETHER_JUMBO_FRAME_MTU = 9000
> +DEFAULT_JUMBO_FRAME_MTU = 1500
> 
>  class TestVhostPmdXstats(TestCase):
> 
> @@ -61,6 +58,8 @@ class TestVhostPmdXstats(TestCase):
>          self.dut.unbind_interfaces_linux(self.unbind_ports)
>          cores = self.dut.get_core_list("1S/4C/1T")
>          self.coremask = utils.create_mask(cores)
> +        txport = self.tester.get_local_port(self.dut_ports[0])
> +        self.txItf = self.tester.get_interface(txport)
> 
>          self.scapy_num = 0
>          self.dmac = self.dut.get_mac_address(self.dut_ports[0])
> @@ -124,8 +123,6 @@ class TestVhostPmdXstats(TestCase):
>          Send a packet to port
>          """
>          self.scapy_num += 1
> -        txport = self.tester.get_local_port(self.dut_ports[0])
> -        self.txItf = self.tester.get_interface(txport)
>          pkt = Packet(pkt_type='TCP', pkt_len=pktsize)
>          pkt.config_layer('ether', {'dst': dmac, })
>          pkt.send_pkt(tx_port=self.txItf, count=num) @@ -166,10 +163,13 @@
> class TestVhostPmdXstats(TestCase):
>          for cat in categories:
>              scope = re.search(r'(?<=rx_)\w+(?=_packets)', cat).group(0)
>              pktsize = int(re.search(r'(?<=rx_size_)\d+', cat).group(0))
> +            if pktsize > 1518:
> +                self.tester.send_expect('ifconfig %s mtu %d' %
> + (self.txItf, ETHER_JUMBO_FRAME_MTU), '# ')
> 
>              self.scapy_send_packet(pktsize, self.dmac, 10000)
>              self.send_verify(scope, 10000)
>              self.clear_port_xstats(scope)
> +        self.tester.send_expect('ifconfig %s mtu %d' % (self.txItf,
> + DEFAULT_JUMBO_FRAME_MTU), '# ')
> 
>      def clear_port_xstats(self, scope):
> 
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26 23:50 [dts] [PATCH V1] tests/vhost_pmd_xstats: fix issue about send pkt lihong
2019-08-27  8:34 ` Wang, Yinan
2019-09-04  5:09 ` Tu, Lijuan

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox