test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [patch V1 1/2] add dpdk send protocol packet size code
@ 2017-01-10  6:54 xu,huilong
  2017-01-10  6:54 ` [dts] [patch V1 2/2] update shutdown_api and jumboframes check tx-packets code xu,huilong
  0 siblings, 1 reply; 4+ messages in thread
From: xu,huilong @ 2017-01-10  6:54 UTC (permalink / raw)
  To: dts; +Cc: xu,huilong

Signed-off-by: "xu,huilong" <huilongx.xu@intel.com>
---
 framework/settings.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/framework/settings.py b/framework/settings.py
index df2a491..acffa34 100644
--- a/framework/settings.py
+++ b/framework/settings.py
@@ -161,7 +161,12 @@ HEADER_SIZE = {
     'tcp': 20,
     'vxlan': 8,
 }
-
+"""
+dpdk send protocol packet size.
+"""
+PROTOCOL_PACKET_SIZE = {
+    'lldp': 110,
+}
 
 """
 Default session timeout.
-- 
1.9.3

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

* [dts] [patch V1 2/2] update shutdown_api and jumboframes check tx-packets code
  2017-01-10  6:54 [dts] [patch V1 1/2] add dpdk send protocol packet size code xu,huilong
@ 2017-01-10  6:54 ` xu,huilong
  2017-01-12  1:20   ` Liu, Yong
  0 siblings, 1 reply; 4+ messages in thread
From: xu,huilong @ 2017-01-10  6:54 UTC (permalink / raw)
  To: dts; +Cc: xu,huilong

fotville nic will send lldp packet when port setup by dpdk testpmd.
so we need update check tx-packets code.
used (tx-packets - forward packet size) %  lldp packet size replace tx-packets == forward packets size

Signed-off-by: "xu,huilong" <huilongx.xu@intel.com>
---
 tests/TestSuite_jumboframes.py  |  5 ++++-
 tests/TestSuite_shutdown_api.py | 16 ++++++++++------
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/tests/TestSuite_jumboframes.py b/tests/TestSuite_jumboframes.py
index 58f2e17..bebee59 100644
--- a/tests/TestSuite_jumboframes.py
+++ b/tests/TestSuite_jumboframes.py
@@ -39,6 +39,7 @@ import re
 from time import sleep
 from test_case import TestCase
 from pmd_output import PmdOutput
+from settings import PROTOCOL_PACKET_SIZE
 
 ETHER_HEADER_LEN = 18
 IP_HEADER_LEN = 20
@@ -93,7 +94,9 @@ class TestJumboframes(TestCase):
         rx_err -= rx_err_ori
 
         if received:
-            self.verify((tx_pkts == rx_pkts) and ((tx_bytes + 4) == pktsize) and ((rx_bytes + 4) == pktsize),
+            self.verify((tx_pkts - rx_pkts % PROTOCOL_PACKET_SIZE['lldp'] == 0) 
+                         and ( (tx_bytes + 4 - pktsize ) % PROTOCOL_PACKET_SIZE['lldp'] == 0) 
+                         and ((rx_bytes + 4) == pktsize),
                         "packet pass assert error")
         else:
             #self.verify(p0tx_pkts == p1rx_pkts and (p1rx_err == 1 or p1rx_pkts == 0),
diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py
index 3dbacf2..5e67bf5 100644
--- a/tests/TestSuite_shutdown_api.py
+++ b/tests/TestSuite_shutdown_api.py
@@ -42,7 +42,7 @@ import re
 import os
 from test_case import TestCase
 from pmd_output import PmdOutput
-from settings import HEADER_SIZE
+from settings import HEADER_SIZE, PROTOCOL_PACKET_SIZE
 from exception import VerifyFailure
 
 #
@@ -149,14 +149,18 @@ class TestShutdownApi(TestCase):
             if vlan is True:
                 # vlan strip default is on
                 tx_bytes_exp -= 4
-
+         
+        # fortville nic enable send lldp packet function when port setup
+        # now the tx-packets size is lldp_size(110) * n + forward packe size
+        # so use (tx-packets - forward packet size) % lldp_size, if it is 0, it means forward packet size right
+ 
         if received:
-            self.verify(p0tx_pkts == p1rx_pkts, "Wrong TX pkts p0_tx=%d, p1_rx=%d" % (p0tx_pkts, p1rx_pkts))
+            self.verify((p0tx_pkts - p1rx_pkts) % PROTOCOL_PACKET_SIZE['lldp'] == 0, "Wrong TX pkts p0_tx=%d, p1_rx=%d" % (p0tx_pkts, p1rx_pkts))
             self.verify(p1rx_bytes == rx_bytes_exp, "Wrong Rx bytes p1_rx=%d, expect=%d" % (p1rx_bytes, rx_bytes_exp))
-            self.verify(p0tx_bytes == tx_bytes_exp, "Wrong Tx bytes p0_tx=%d, expect=%d" % (p0tx_bytes, tx_bytes_exp))
+            self.verify((p0tx_bytes - tx_bytes_exp) % PROTOCOL_PACKET_SIZE['lldp'] == 0, "Wrong Tx bytes p0_tx=%d, expect=%d" % (p0tx_bytes, tx_bytes_exp))
         else:
-            self.verify(p0tx_pkts == 0, "Packet not dropped p0tx_pkts=%d" % p0tx_pkts)
-            self.verify(p0tx_bytes == 0, "Packet not dropped p0tx_bytes=%d" % p0tx_bytes)
+            self.verify(p0tx_pkts % PROTOCOL_PACKET_SIZE['lldp'] == 0, "Packet not dropped p0tx_pkts=%d" % p0tx_pkts)
+            self.verify(p0tx_bytes % PROTOCOL_PACKET_SIZE['lldp'] == 0, "Packet not dropped p0tx_bytes=%d" % p0tx_bytes)
 
     def check_ports(self, status=True):
         """
-- 
1.9.3

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

* Re: [dts] [patch V1 2/2] update shutdown_api and jumboframes check tx-packets code
  2017-01-10  6:54 ` [dts] [patch V1 2/2] update shutdown_api and jumboframes check tx-packets code xu,huilong
@ 2017-01-12  1:20   ` Liu, Yong
  2017-01-12  2:02     ` Xu, HuilongX
  0 siblings, 1 reply; 4+ messages in thread
From: Liu, Yong @ 2017-01-12  1:20 UTC (permalink / raw)
  To: Xu, HuilongX, dts; +Cc: Xu, HuilongX

Huilong, 
There're lots of function may affected if we can't avoid LLDP packets sending out from dpdk drive Fortville port.
We need a list about which case will be affected by this issue.  And we need to abstract one function to check packet size.
Function input will be expected received or transmitted size and return value is just meet the expectation or not.

Regards,
Marvin

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong
> Sent: Tuesday, January 10, 2017 2:55 PM
> To: dts@dpdk.org
> Cc: Xu, HuilongX <huilongx.xu@intel.com>
> Subject: [dts] [patch V1 2/2] update shutdown_api and jumboframes check tx-
> packets code
> 
> fotville nic will send lldp packet when port setup by dpdk testpmd.
> so we need update check tx-packets code.
> used (tx-packets - forward packet size) %  lldp packet size replace tx-packets ==
> forward packets size
> 
> Signed-off-by: "xu,huilong" <huilongx.xu@intel.com>
> ---
>  tests/TestSuite_jumboframes.py  |  5 ++++-  tests/TestSuite_shutdown_api.py |
> 16 ++++++++++------
>  2 files changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/TestSuite_jumboframes.py b/tests/TestSuite_jumboframes.py
> index 58f2e17..bebee59 100644
> --- a/tests/TestSuite_jumboframes.py
> +++ b/tests/TestSuite_jumboframes.py
> @@ -39,6 +39,7 @@ import re
>  from time import sleep
>  from test_case import TestCase
>  from pmd_output import PmdOutput
> +from settings import PROTOCOL_PACKET_SIZE
> 
>  ETHER_HEADER_LEN = 18
>  IP_HEADER_LEN = 20
> @@ -93,7 +94,9 @@ class TestJumboframes(TestCase):
>          rx_err -= rx_err_ori
> 
>          if received:
> -            self.verify((tx_pkts == rx_pkts) and ((tx_bytes + 4) == pktsize) and
> ((rx_bytes + 4) == pktsize),
> +            self.verify((tx_pkts - rx_pkts % PROTOCOL_PACKET_SIZE['lldp'] == 0)
> +                         and ( (tx_bytes + 4 - pktsize ) % PROTOCOL_PACKET_SIZE['lldp']
> == 0)
> +                         and ((rx_bytes + 4) == pktsize),
>                          "packet pass assert error")
>          else:
>              #self.verify(p0tx_pkts == p1rx_pkts and (p1rx_err == 1 or p1rx_pkts == 0),
> diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py
> index 3dbacf2..5e67bf5 100644
> --- a/tests/TestSuite_shutdown_api.py
> +++ b/tests/TestSuite_shutdown_api.py
> @@ -42,7 +42,7 @@ import re
>  import os
>  from test_case import TestCase
>  from pmd_output import PmdOutput
> -from settings import HEADER_SIZE
> +from settings import HEADER_SIZE, PROTOCOL_PACKET_SIZE
>  from exception import VerifyFailure
> 
>  #
> @@ -149,14 +149,18 @@ class TestShutdownApi(TestCase):
>              if vlan is True:
>                  # vlan strip default is on
>                  tx_bytes_exp -= 4
> -
> +
> +        # fortville nic enable send lldp packet function when port setup
> +        # now the tx-packets size is lldp_size(110) * n + forward packe size
> +        # so use (tx-packets - forward packet size) % lldp_size, if it
> + is 0, it means forward packet size right
> +
>          if received:
> -            self.verify(p0tx_pkts == p1rx_pkts, "Wrong TX pkts p0_tx=%d,
> p1_rx=%d" % (p0tx_pkts, p1rx_pkts))
> +            self.verify((p0tx_pkts - p1rx_pkts) %
> + PROTOCOL_PACKET_SIZE['lldp'] == 0, "Wrong TX pkts p0_tx=%d, p1_rx=%d"
> + % (p0tx_pkts, p1rx_pkts))
>              self.verify(p1rx_bytes == rx_bytes_exp, "Wrong Rx bytes p1_rx=%d,
> expect=%d" % (p1rx_bytes, rx_bytes_exp))
> -            self.verify(p0tx_bytes == tx_bytes_exp, "Wrong Tx bytes p0_tx=%d,
> expect=%d" % (p0tx_bytes, tx_bytes_exp))
> +            self.verify((p0tx_bytes - tx_bytes_exp) %
> + PROTOCOL_PACKET_SIZE['lldp'] == 0, "Wrong Tx bytes p0_tx=%d,
> + expect=%d" % (p0tx_bytes, tx_bytes_exp))
>          else:
> -            self.verify(p0tx_pkts == 0, "Packet not dropped p0tx_pkts=%d" %
> p0tx_pkts)
> -            self.verify(p0tx_bytes == 0, "Packet not dropped p0tx_bytes=%d" %
> p0tx_bytes)
> +            self.verify(p0tx_pkts % PROTOCOL_PACKET_SIZE['lldp'] == 0, "Packet not
> dropped p0tx_pkts=%d" % p0tx_pkts)
> +            self.verify(p0tx_bytes % PROTOCOL_PACKET_SIZE['lldp'] == 0,
> + "Packet not dropped p0tx_bytes=%d" % p0tx_bytes)
> 
>      def check_ports(self, status=True):
>          """
> --
> 1.9.3

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

* Re: [dts] [patch V1 2/2] update shutdown_api and jumboframes check tx-packets code
  2017-01-12  1:20   ` Liu, Yong
@ 2017-01-12  2:02     ` Xu, HuilongX
  0 siblings, 0 replies; 4+ messages in thread
From: Xu, HuilongX @ 2017-01-12  2:02 UTC (permalink / raw)
  To: Liu, Yong, dts

Yes, I will send V2 patch for check tx-bytes.
Thanks  a lot

> -----Original Message-----
> From: Liu, Yong
> Sent: Thursday, January 12, 2017 9:20 AM
> To: Xu, HuilongX; dts@dpdk.org
> Cc: Xu, HuilongX
> Subject: RE: [dts] [patch V1 2/2] update shutdown_api and jumboframes
> check tx-packets code
> 
> Huilong,
> There're lots of function may affected if we can't avoid LLDP packets sending
> out from dpdk drive Fortville port.
> We need a list about which case will be affected by this issue.  And we need
> to abstract one function to check packet size.
> Function input will be expected received or transmitted size and return value
> is just meet the expectation or not.
> 
> Regards,
> Marvin
> 
> > -----Original Message-----
> > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong
> > Sent: Tuesday, January 10, 2017 2:55 PM
> > To: dts@dpdk.org
> > Cc: Xu, HuilongX <huilongx.xu@intel.com>
> > Subject: [dts] [patch V1 2/2] update shutdown_api and jumboframes
> > check tx- packets code
> >
> > fotville nic will send lldp packet when port setup by dpdk testpmd.
> > so we need update check tx-packets code.
> > used (tx-packets - forward packet size) %  lldp packet size replace
> > tx-packets == forward packets size
> >
> > Signed-off-by: "xu,huilong" <huilongx.xu@intel.com>
> > ---
> >  tests/TestSuite_jumboframes.py  |  5 ++++-
> > tests/TestSuite_shutdown_api.py |
> > 16 ++++++++++------
> >  2 files changed, 14 insertions(+), 7 deletions(-)
> >
> > diff --git a/tests/TestSuite_jumboframes.py
> > b/tests/TestSuite_jumboframes.py index 58f2e17..bebee59 100644
> > --- a/tests/TestSuite_jumboframes.py
> > +++ b/tests/TestSuite_jumboframes.py
> > @@ -39,6 +39,7 @@ import re
> >  from time import sleep
> >  from test_case import TestCase
> >  from pmd_output import PmdOutput
> > +from settings import PROTOCOL_PACKET_SIZE
> >
> >  ETHER_HEADER_LEN = 18
> >  IP_HEADER_LEN = 20
> > @@ -93,7 +94,9 @@ class TestJumboframes(TestCase):
> >          rx_err -= rx_err_ori
> >
> >          if received:
> > -            self.verify((tx_pkts == rx_pkts) and ((tx_bytes + 4) == pktsize) and
> > ((rx_bytes + 4) == pktsize),
> > +            self.verify((tx_pkts - rx_pkts % PROTOCOL_PACKET_SIZE['lldp'] == 0)
> > +                         and ( (tx_bytes + 4 - pktsize ) %
> > + PROTOCOL_PACKET_SIZE['lldp']
> > == 0)
> > +                         and ((rx_bytes + 4) == pktsize),
> >                          "packet pass assert error")
> >          else:
> >              #self.verify(p0tx_pkts == p1rx_pkts and (p1rx_err == 1 or
> > p1rx_pkts == 0), diff --git a/tests/TestSuite_shutdown_api.py
> > b/tests/TestSuite_shutdown_api.py index 3dbacf2..5e67bf5 100644
> > --- a/tests/TestSuite_shutdown_api.py
> > +++ b/tests/TestSuite_shutdown_api.py
> > @@ -42,7 +42,7 @@ import re
> >  import os
> >  from test_case import TestCase
> >  from pmd_output import PmdOutput
> > -from settings import HEADER_SIZE
> > +from settings import HEADER_SIZE, PROTOCOL_PACKET_SIZE
> >  from exception import VerifyFailure
> >
> >  #
> > @@ -149,14 +149,18 @@ class TestShutdownApi(TestCase):
> >              if vlan is True:
> >                  # vlan strip default is on
> >                  tx_bytes_exp -= 4
> > -
> > +
> > +        # fortville nic enable send lldp packet function when port setup
> > +        # now the tx-packets size is lldp_size(110) * n + forward packe size
> > +        # so use (tx-packets - forward packet size) % lldp_size, if
> > + it is 0, it means forward packet size right
> > +
> >          if received:
> > -            self.verify(p0tx_pkts == p1rx_pkts, "Wrong TX pkts p0_tx=%d,
> > p1_rx=%d" % (p0tx_pkts, p1rx_pkts))
> > +            self.verify((p0tx_pkts - p1rx_pkts) %
> > + PROTOCOL_PACKET_SIZE['lldp'] == 0, "Wrong TX pkts p0_tx=%d,
> p1_rx=%d"
> > + % (p0tx_pkts, p1rx_pkts))
> >              self.verify(p1rx_bytes == rx_bytes_exp, "Wrong Rx bytes
> > p1_rx=%d, expect=%d" % (p1rx_bytes, rx_bytes_exp))
> > -            self.verify(p0tx_bytes == tx_bytes_exp, "Wrong Tx bytes p0_tx=%d,
> > expect=%d" % (p0tx_bytes, tx_bytes_exp))
> > +            self.verify((p0tx_bytes - tx_bytes_exp) %
> > + PROTOCOL_PACKET_SIZE['lldp'] == 0, "Wrong Tx bytes p0_tx=%d,
> > + expect=%d" % (p0tx_bytes, tx_bytes_exp))
> >          else:
> > -            self.verify(p0tx_pkts == 0, "Packet not dropped p0tx_pkts=%d" %
> > p0tx_pkts)
> > -            self.verify(p0tx_bytes == 0, "Packet not dropped p0tx_bytes=%d" %
> > p0tx_bytes)
> > +            self.verify(p0tx_pkts % PROTOCOL_PACKET_SIZE['lldp'] ==
> > + 0, "Packet not
> > dropped p0tx_pkts=%d" % p0tx_pkts)
> > +            self.verify(p0tx_bytes % PROTOCOL_PACKET_SIZE['lldp'] ==
> > + 0, "Packet not dropped p0tx_bytes=%d" % p0tx_bytes)
> >
> >      def check_ports(self, status=True):
> >          """
> > --
> > 1.9.3

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

end of thread, other threads:[~2017-01-12  2:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-10  6:54 [dts] [patch V1 1/2] add dpdk send protocol packet size code xu,huilong
2017-01-10  6:54 ` [dts] [patch V1 2/2] update shutdown_api and jumboframes check tx-packets code xu,huilong
2017-01-12  1:20   ` Liu, Yong
2017-01-12  2:02     ` Xu, HuilongX

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).