test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V1 1/2] tests/smoke_base modify ixgbe support vf jumbo verify.
@ 2022-05-09  7:46 Weiyuan Li
  2022-05-09  7:46 ` [dts][PATCH V1 2/2] tests/vf_smoke " Weiyuan Li
  2022-05-10  3:31 ` [dts][PATCH V1 1/2] tests/smoke_base " Peng, Yuan
  0 siblings, 2 replies; 4+ messages in thread
From: Weiyuan Li @ 2022-05-09  7:46 UTC (permalink / raw)
  To: dts, yuan.peng; +Cc: Weiyuan Li

the ixgbe NIC only supports one global MTU per physical port.
So when the user sets different MTUs on PF and VF ports in one physical port,
the real MTU for all these PF and VF ports is the largest value set.
This behavior is based on the kernel driver behavior.

So, modify script supports the verification packet sent is greater than PF MTU for ixgbe driver.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---
 tests/smoke_base.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/tests/smoke_base.py b/tests/smoke_base.py
index bb49c784..4b3fe9eb 100644
--- a/tests/smoke_base.py
+++ b/tests/smoke_base.py
@@ -51,12 +51,23 @@ class SmokeTest(object):
             setattr(self, name, kwargs[name])
 
     def send_pkg_return_stats(
-        self, pkt_size=COMMON_PKT_LEN, l3_src=IPV4_SRC, l3_dst=IPV4_DST, rss=False
+        self, pkt_size=COMMON_PKT_LEN, l3_src=IPV4_SRC, l3_dst=IPV4_DST, rss=False, driver=None
     ):
         self.test_case.dut.send_expect("clear port stats all", "testpmd> ")
         l3_len = pkt_size - HEADER_SIZE["eth"]
         payload = pkt_size - HEADER_SIZE["eth"] - HEADER_SIZE["ip"]
         hash_flag = False
+        # For ixgbe, jumbo frame is not supported. MTU is determined by pf.
+        # so, testpmd max-pkt-len=9000 don't work.
+        # Although the user can set the MTU separately on PF and VF ports,
+        # the ixgbe NIC only supports one global MTU per physical port.
+        # So when the user sets different MTUs on PF and VF ports in one physical port,
+        # the real MTU for all these PF and VF ports is the largest value set.
+        # This behavior is based on the kernel driver behavior.
+        # The packet sent is greater than PF MTU 9000, the payload equal to 8083,
+        # PF received packet MTU = payload + IP, 8083 + 20 = 9001
+        if driver == 'ixgbe':
+            payload = pkt_size - HEADER_SIZE["eth"]
         if rss:
             pkt = []
             # generate PACKAGE_COUNT count package, the IP dst is random.
@@ -113,14 +124,14 @@ class SmokeTest(object):
             return queues[0], stats
         return None, stats
 
-    def check_jumbo_frames(self):
+    def check_jumbo_frames(self, kdriver=None):
         """
         The packet total size include ethernet header, ip header, and payload.
         ethernet header length is 18 bytes, ip standard header length is 20 bytes.
         The packet forwarded failed.
         """
         pkg_size = JUMBO_FRAME_LENGTH + 1
-        queues, stats = self.send_pkg_return_stats(pkg_size)
+        queues, stats = self.send_pkg_return_stats(pkg_size, driver=kdriver)
         if 1 != stats["RX-errors"] and 0 != stats["TX-packets"]:
             self.test_case.logger.info(
                 "jumbo frame: The RX[{}] or TX[{}] packet error".format(
-- 
2.18.2


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

* [dts][PATCH V1 2/2] tests/vf_smoke modify ixgbe support vf jumbo verify.
  2022-05-09  7:46 [dts][PATCH V1 1/2] tests/smoke_base modify ixgbe support vf jumbo verify Weiyuan Li
@ 2022-05-09  7:46 ` Weiyuan Li
  2022-05-10  2:46   ` Chen, LingliX
  2022-05-10  3:31 ` [dts][PATCH V1 1/2] tests/smoke_base " Peng, Yuan
  1 sibling, 1 reply; 4+ messages in thread
From: Weiyuan Li @ 2022-05-09  7:46 UTC (permalink / raw)
  To: dts, yuan.peng; +Cc: Weiyuan Li

Modify script supports set PF MTU for ixgbe driver.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---
 tests/TestSuite_vf_smoke.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_vf_smoke.py b/tests/TestSuite_vf_smoke.py
index e4f0c31b..685a54a0 100644
--- a/tests/TestSuite_vf_smoke.py
+++ b/tests/TestSuite_vf_smoke.py
@@ -32,6 +32,7 @@
 from framework.packet import Packet
 from framework.pmd_output import PmdOutput
 from framework.test_case import TestCase
+from framework.utils import RED
 
 from .smoke_base import (
     DEFAULT_MTU_VALUE,
@@ -74,6 +75,7 @@ class TestVfSmoke(TestCase):
 
         # generate vf
         self.dut.bind_interfaces_linux(self.kdriver)
+        self.set_pf_mtu()
         self.dut.generate_sriov_vfs_by_port(self.smoke_dut_ports[0], 1, self.kdriver)
         self.vf_ports = self.dut.ports_info[self.smoke_dut_ports[0]]["vfs_port"]
         self.verify(len(self.vf_ports) != 0, "VF create failed")
@@ -121,6 +123,12 @@ class TestVfSmoke(TestCase):
         if out == "" or "No such file or directory" in out:
             self.vf_launch_dpdk_app()
 
+    def set_pf_mtu(self):
+        self.dut.send_expect(f"ifconfig {self.pf_interface} mtu {JUMBO_FRAME_LENGTH}", "# ")
+        out = self.dut.send_expect(f"ip link show {self.pf_interface}", "# ")
+        if '9000' not in out:
+            print(RED("Please set mtu for case vf_jumbo_frames case!"))
+
     def vf_launch_dpdk_app(self):
         self.pmd_out.start_testpmd(cores=self.cores, ports=self.ports, param=self.param)
 
@@ -137,7 +145,7 @@ class TestVfSmoke(TestCase):
         self.dut.send_expect("set fwd mac", "testpmd> ")
         self.dut.send_expect("start", "testpmd> ")
         self.pmd_out.wait_link_status_up(self.smoke_dut_ports[0])
-        result = self.test_func.check_jumbo_frames()
+        result = self.test_func.check_jumbo_frames(self.kdriver)
         self.verify(result, "enable disable jumbo frames failed")
 
     def test_vf_rss(self):
-- 
2.18.2


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

* RE: [dts][PATCH V1 2/2] tests/vf_smoke modify ixgbe support vf jumbo verify.
  2022-05-09  7:46 ` [dts][PATCH V1 2/2] tests/vf_smoke " Weiyuan Li
@ 2022-05-10  2:46   ` Chen, LingliX
  0 siblings, 0 replies; 4+ messages in thread
From: Chen, LingliX @ 2022-05-10  2:46 UTC (permalink / raw)
  To: dts; +Cc: Li, WeiyuanX

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]


> -----Original Message-----
> From: Weiyuan Li <weiyuanx.li@intel.com>
> Sent: Monday, May 9, 2022 3:47 PM
> To: dts@dpdk.org; Peng, Yuan <yuan.peng@intel.com>
> Cc: Li, WeiyuanX <weiyuanx.li@intel.com>
> Subject: [dts][PATCH V1 2/2] tests/vf_smoke modify ixgbe support vf jumbo
> verify.
> 
> Modify script supports set PF MTU for ixgbe driver.
> 
> Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
> ---

Tested-by: Lingli Chen <linglix.chen@intel.com>

[-- Attachment #2: TestVfSmoke.log --]
[-- Type: application/octet-stream, Size: 12210 bytes --]

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

* RE: [dts][PATCH V1 1/2] tests/smoke_base modify ixgbe support vf jumbo verify.
  2022-05-09  7:46 [dts][PATCH V1 1/2] tests/smoke_base modify ixgbe support vf jumbo verify Weiyuan Li
  2022-05-09  7:46 ` [dts][PATCH V1 2/2] tests/vf_smoke " Weiyuan Li
@ 2022-05-10  3:31 ` Peng, Yuan
  1 sibling, 0 replies; 4+ messages in thread
From: Peng, Yuan @ 2022-05-10  3:31 UTC (permalink / raw)
  To: Li, WeiyuanX, dts

Acked-by: Peng, Yuan <yuan.peng@intel.com>

-----Original Message-----
From: Li, WeiyuanX <weiyuanx.li@intel.com> 
Sent: Monday, May 9, 2022 3:47 PM
To: dts@dpdk.org; Peng, Yuan <yuan.peng@intel.com>
Cc: Li, WeiyuanX <weiyuanx.li@intel.com>
Subject: [dts][PATCH V1 1/2] tests/smoke_base modify ixgbe support vf jumbo verify.

the ixgbe NIC only supports one global MTU per physical port.
So when the user sets different MTUs on PF and VF ports in one physical port, the real MTU for all these PF and VF ports is the largest value set.
This behavior is based on the kernel driver behavior.

So, modify script supports the verification packet sent is greater than PF MTU for ixgbe driver.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>

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

end of thread, other threads:[~2022-05-10  3:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09  7:46 [dts][PATCH V1 1/2] tests/smoke_base modify ixgbe support vf jumbo verify Weiyuan Li
2022-05-09  7:46 ` [dts][PATCH V1 2/2] tests/vf_smoke " Weiyuan Li
2022-05-10  2:46   ` Chen, LingliX
2022-05-10  3:31 ` [dts][PATCH V1 1/2] tests/smoke_base " Peng, Yuan

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	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

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


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