test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] test_plan/link_flow_ctrl: new cases for port stop/start
@ 2020-06-03 16:45 Lijuan Tu
  2020-06-19 15:21 ` [dts] [PATCH v2] " Lijuan Tu
  0 siblings, 1 reply; 3+ messages in thread
From: Lijuan Tu @ 2020-06-03 16:45 UTC (permalink / raw)
  To: dts; +Cc: Lijuan Tu

* add new cases (also not inclued in script):
  - test_pause_fwd_port_stop_start
  - test_perf_flowctrl_on_port_stop_start

* add missing cases (already inclued in script):
  - test_flowctrl_off_pause_fwd_on
  - test_flowctrl_off_pause_fwd_off

* more description
* more organized

Signed-off-by: Lijuan Tu <lijuan.tu@intel.com>
---
 test_plans/link_flowctrl_test_plan.rst | 211 +++++++++++++++++++++++++++------
 1 file changed, 177 insertions(+), 34 deletions(-)

diff --git a/test_plans/link_flowctrl_test_plan.rst b/test_plans/link_flowctrl_test_plan.rst
index d028e67..c8722c4 100644
--- a/test_plans/link_flowctrl_test_plan.rst
+++ b/test_plans/link_flowctrl_test_plan.rst
@@ -52,13 +52,37 @@ MAC Control Frame Forwarding consists in:
 - When Flow Control and MAC Control Frame Forwarding are enabled the PAUSE
   frames will be passed to the host and can be handled by testpmd.
 
-Note: Priority flow control is not included in this test plan.
+.. note::
 
-Note: the high_water, low_water, pause_time, send_xon are configured into the
-NIC register. It is not necessary to validate the accuracy of these parameters.
-And what change it can cause. The port_id is used to indicate the NIC to be
-configured. In certain case, a system can contain multiple NIC. However the NIC
-need not be configured multiple times.
+   Priority flow control is not included in this test plan.
+
+Configuration Functions in testpmd:
+
+Set the link flow control parameter on a port::
+
+  testpmd> set flow_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \
+         (pause_time) (send_xon) mac_ctrl_frame_fwd (on|off) \
+         autoneg (on|off) (port_id)
+
+* ``high_water`` (integer): High threshold value to trigger XOFF.
+
+* ``low_water`` (integer): Low threshold value to trigger XON.
+
+* ``pause_time`` (integer): Pause quota in the Pause frame.
+
+* ``send_xon`` (0/1): Send XON frame.
+
+* ``mac_ctrl_frame_fwd``: Enable receiving MAC control frames.
+
+* ``autoneg``: Change the auto-negotiation parameter.
+
+.. note::
+
+   the high_water, low_water, pause_time, send_xon are configured into the
+   NIC register. It is not necessary to validate the accuracy of these parameters.
+   And what change it can cause. The port_id is used to indicate the NIC to be
+   configured. In certain case, a system can contain multiple NIC. However the NIC
+   need not be configured multiple times.
 
 
 Prerequisites
@@ -81,12 +105,16 @@ to the device under test::
    modprobe vfio-pci
    usertools/dpdk-devbind.py --bind=vfio-pci device_bus_id
 
-Test Case: test_perf_flowctrl_on_pause_fwd_on
-=============================================
 
-::
+Test Case: Ethernet link flow control
+=====================================
+This case series are focus on ``Ethernet link flow control features``, requires a high-speed packet generator, such as ixia.
 
-  testpmd> set flowctrl rx on tx on high_water low_water pause_time
+Subcase: test_perf_flowctrl_on_pause_fwd_on
+-------------------------------------------
+Enable both link flow control and PAUSE frame forwarding::
+
+  testpmd> set flow_ctrl rx on tx on high_water low_water pause_time
   send_xon mac_ctrl_frame_fwd on autoneg on port_id
 
 Setup the ``csum`` forwarding mode::
@@ -104,7 +132,7 @@ Start the packet forwarding::
     TX queues=1 - TX desc=512 - TX free threshold=0
     TX threshold registers: pthresh=32 hthresh=8 wthresh=8
 
-Validate the NIC can generate the pause frame?
+Validate the NIC can generate the pause frame(``tx on``).
 Configure the traffic generator to send IPv4/UDP packet at the length of 66Byte
 at the line speed (10G). Because the 66Byte packet cannot reach line rate when
 running with testpmd, so it is expected that the pause frame will be sent to the
@@ -114,35 +142,33 @@ It is strongly recommended that the user look into the data sheet before doing
 any flow control configuration. By default, the flow control on 10G is disabled.
 the flow control for 1G is enabled.
 
-Validate the NIC can deal with the pause frame.
+Validate the NIC can deal with the pause frame(``rx on``).
 Configure the traffic generator to send out large amount of pause frames, this
 will cause the NIC to disable / slow down the packet transmission according to
 the pause time. Once the traffic generator stop sending the pause frame, the NIC
 will restore the packet transmission to the expected rate.
 
+Subcase: test_perf_flowctrl_on_pause_fwd_off
+--------------------------------------------
+Enable link flow control and Disable PAUSE frame forwarding::
 
-Test Case: test_perf_flowctrl_on_pause_fwd_off
-==============================================
-::
-
-  testpmd> set flowctrl rx on tx on high_water low_water pause_time
+  testpmd> set flow_ctrl rx on tx on high_water low_water pause_time
   send_xon mac_ctrl_frame_fwd off autoneg on port_id
 
-Validate same behavior as test_perf_flowctrl_on_pause_fwd_on
-
+Validate same behavior as ``test_perf_flowctrl_on_pause_fwd_on``
 
-Test Case: test_perf_flowctrl_rx_on
-===================================
-::
+Subcase: test_perf_flowctrl_rx_on
+---------------------------------
+Enable only rx link flow control::
 
-  testpmd> set flowctrl rx on tx on high_water low_water pause_time
+  testpmd> set flowctrl rx on tx off high_water low_water pause_time
   send_xon mac_ctrl_frame_fwd off autoneg on port_id
 
-Validate same behavior as test_perf_flowctrl_on_pause_fwd_on
+Validate the NIC can deal with the pause frame(``rx on``).
 
-
-Test Case: test_perf_flowctrl_off_pause_fwd_off
-===============================================
+Subcase: test_perf_flowctrl_off_pause_fwd_off
+---------------------------------------------
+Disable both link flow control and PAUSE frame forwarding.
 This is the default mode for 10G PMD, by default, testpmd is running on this mode.
 no need to execute any command::
 
@@ -154,20 +180,137 @@ enough. Packet loss can be observed.
 Validate the NIC will not slow down the packet transmission after receiving the
 pause frame.
 
-Test Case: test_perf_flowctrl_off_pause_fwd_on
-==============================================
-::
+Subcase: test_perf_flowctrl_off_pause_fwd_on
+--------------------------------------------
+Disable link flow control and enable PAUSE frame forwarding::
 
   testpmd> set flowctrl rx off tx off high_water low_water pause_time
   send_xon mac_ctrl_frame_fwd on autoneg on port_id
 
-Validate same behavior as test_perf_flowctrl_off_pause_fwd_off
+Validate same behavior as ``test_perf_flowctrl_off_pause_fwd_off``
 
-Test Case: test_perf_flowctrl_tx_on
-===================================
-::
+Subcase: test_perf_flowctrl_tx_on
+---------------------------------
+Enable only tx link flow control::
 
   testpmd> set flowctrl rx off tx on high_water low_water pause_time
   send_xon mac_ctrl_frame_fwd off autoneg on port_id
 
 Validate same behavior as test_perf_flowctrl_on_pause_fwd_off
+
+Subcase: test_perf_flowctrl_on_port_stop_start
+----------------------------------------------
+Link flow control setting still working after port stop/start.
+
+* ``enable`` Link flow control::
+
+    testpmd> set flow_ctrl rx on 0 tx on 0
+
+  validate behavior same as ``test_perf_flowctrl_on_pause_fwd_off``.
+
+  Stop and start port::
+
+    testpmd> stop
+    testpmd> port stop 0
+    testpmd> port start 0
+    testpmd> start
+
+  validate behavior same as ``test_perf_flowctrl_on_pause_fwd_off``.
+
+
+* ``disable`` Link flow control::
+
+    testpmd> set flow_ctrl rx on 0 tx on 0
+
+  validate behavior same as ``test_perf_flowctrl_off_pause_fwd_off``.
+
+  Stop and start port::
+
+    testpmd> stop
+    testpmd> port stop 0
+    testpmd> port start 0
+    testpmd> start
+
+  validate behavior same as ``test_perf_flowctrl_off_pause_fwd_off``.
+
+
+Test Case: MAC Control Frame Forwarding
+=======================================
+This case series foucs on ``MAC Control Frame Forwarding``, no requirment of
+high-speed packets, it's very friendship to use scapy as packet generator.
+
+Subcase: test_flowctrl_off_pause_fwd_off
+----------------------------------------
+PAUSE Frames will not be received by testpmd while Flow Control disabled and
+MAC Control Frame Forwarding disabled::
+
+  testpmd> set flow_ctrl rx off tx off 300 50 10 1 mac_ctrl_frame_fwd off autoneg off 0
+
+Send PAUSE packets to DUT with below options:
+
+* Regular frame (correct src and dst mac addresses and opcode)
+* Wrong source frame (wrong src, correct and dst mac address and correct opcode)
+* Wrong opcode frame (correct src and dst mac address and wrong opcode)
+* Wrong destination frame (correct src mac and opcode, wrong dst mac address)
+
+Validate no packet received by testpmd according to ``show port stats all``
+
+Subcase: test_flowctrl_off_pause_fwd_on
+---------------------------------------
+All PAUSE Frames will be forwarded by testpmd while Flow Control disabled and
+MAC Control Frame Forwarding enabled::
+
+  testpmd> set flow_ctrl rx off tx off 300 50 10 1 mac_ctrl_frame_fwd on autoneg off 0
+
+Send PAUSE packets to DUT with same options as ``test_flowctrl_off_pause_fwd_off``
+
+Validate port statistic match below table
+
+.. table::
+
+   +-------+-----------------+---------------+
+   |   #   | Frames          | Received      |
+   +=======+=================+===============+
+   |   0   | Regular frame   | Yes           |
+   +-------+-----------------+---------------+
+   |   1   | Wrong src mac   | Yes           |
+   +-------+-----------------+---------------+
+   |   2   | Wrong opcode    | Yes           |
+   +-------+-----------------+---------------+
+   |   3   | Wrong dst mac   | Yes           |
+   +-------+-----------------+---------------+
+
+Subcase: test_pause_fwd_port_stop_start
+---------------------------------------
+MAC Control Frame Forwarding setting still working after port stop/start.
+
+* ``enable`` MAC Control Frame Forwarding, and validate packets are received::
+
+    testpmd> set flow_ctrl mac_ctrl_frame_fwd on 0
+
+  Send regular PAUSE packets to DUT, and validate packets are received.
+
+  Stop and start port::
+
+    testpmd> stop
+    testpmd> port stop 0
+    testpmd> port start 0
+    testpmd> start
+
+  Send regular PAUSE packets to DUT, and validate packets are received.
+
+
+* ``disable`` MAC Control Frame Forwarding, and validate ``no`` packets are received::
+
+    testpmd> set flow_ctrl mac_ctrl_frame_fwd off 0
+
+  Send regular PAUSE packets to DUT, and validate ``no`` packets are received.
+
+  Stop and start port::
+
+    testpmd> stop
+    testpmd> port stop 0
+    testpmd> port start 0
+    testpmd> start
+
+  Send regular PAUSE packets to DUT, and validate ``no`` packets are received.
-- 
1.8.3.1


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

* [dts] [PATCH v2] test_plan/link_flow_ctrl: new cases for port stop/start
  2020-06-03 16:45 [dts] [PATCH] test_plan/link_flow_ctrl: new cases for port stop/start Lijuan Tu
@ 2020-06-19 15:21 ` Lijuan Tu
  2020-07-01  5:54   ` Tu, Lijuan
  0 siblings, 1 reply; 3+ messages in thread
From: Lijuan Tu @ 2020-06-19 15:21 UTC (permalink / raw)
  To: lijuan.tu; +Cc: dts

* add new cases (also not inclued in script):
  - test_pause_fwd_port_stop_start
  - test_perf_flowctrl_on_port_stop_start

* add missing cases (already inclued in script):
  - test_flowctrl_off_pause_fwd_on
  - test_flowctrl_off_pause_fwd_off

* more description
* more organized

Signed-off-by: Lijuan Tu <lijuan.tu@intel.com>
---
 test_plans/link_flowctrl_test_plan.rst | 213 +++++++++++++++++++++++++++------
 1 file changed, 179 insertions(+), 34 deletions(-)

diff --git a/test_plans/link_flowctrl_test_plan.rst b/test_plans/link_flowctrl_test_plan.rst
index d028e67..d3bd8af 100644
--- a/test_plans/link_flowctrl_test_plan.rst
+++ b/test_plans/link_flowctrl_test_plan.rst
@@ -52,13 +52,37 @@ MAC Control Frame Forwarding consists in:
 - When Flow Control and MAC Control Frame Forwarding are enabled the PAUSE
   frames will be passed to the host and can be handled by testpmd.
 
-Note: Priority flow control is not included in this test plan.
+.. note::
 
-Note: the high_water, low_water, pause_time, send_xon are configured into the
-NIC register. It is not necessary to validate the accuracy of these parameters.
-And what change it can cause. The port_id is used to indicate the NIC to be
-configured. In certain case, a system can contain multiple NIC. However the NIC
-need not be configured multiple times.
+   Priority flow control is not included in this test plan.
+
+Configuration Functions in testpmd:
+
+  Set the link flow control parameter on a port::
+
+    testpmd> set flow_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \
+           (pause_time) (send_xon) mac_ctrl_frame_fwd (on|off) \
+           autoneg (on|off) (port_id)
+
+  * ``high_water`` (integer): High threshold value to trigger XOFF.
+
+  * ``low_water`` (integer): Low threshold value to trigger XON.
+
+  * ``pause_time`` (integer): Pause quota in the Pause frame.
+
+  * ``send_xon`` (0/1): Send XON frame.
+
+  * ``mac_ctrl_frame_fwd``: Enable receiving MAC control frames.
+
+  * ``autoneg``: Change the auto-negotiation parameter.
+
+  .. note::
+
+     the high_water, low_water, pause_time, send_xon are configured into the
+     NIC register. It is not necessary to validate the accuracy of these parameters.
+     And what change it can cause. The port_id is used to indicate the NIC to be
+     configured. In certain case, a system can contain multiple NIC. However the NIC
+     need not be configured multiple times.
 
 
 Prerequisites
@@ -81,12 +105,16 @@ to the device under test::
    modprobe vfio-pci
    usertools/dpdk-devbind.py --bind=vfio-pci device_bus_id
 
-Test Case: test_perf_flowctrl_on_pause_fwd_on
-=============================================
 
-::
+Test Case: Ethernet link flow control
+=====================================
+This case series are focus on ``Ethernet link flow control features``, requires a high-speed packet generator, such as ixia.
 
-  testpmd> set flowctrl rx on tx on high_water low_water pause_time
+Subcase: test_perf_flowctrl_on_pause_fwd_on
+-------------------------------------------
+Enable both link flow control and PAUSE frame forwarding::
+
+  testpmd> set flow_ctrl rx on tx on high_water low_water pause_time
   send_xon mac_ctrl_frame_fwd on autoneg on port_id
 
 Setup the ``csum`` forwarding mode::
@@ -104,7 +132,7 @@ Start the packet forwarding::
     TX queues=1 - TX desc=512 - TX free threshold=0
     TX threshold registers: pthresh=32 hthresh=8 wthresh=8
 
-Validate the NIC can generate the pause frame?
+Validate the NIC can generate the pause frame(``tx on``).
 Configure the traffic generator to send IPv4/UDP packet at the length of 66Byte
 at the line speed (10G). Because the 66Byte packet cannot reach line rate when
 running with testpmd, so it is expected that the pause frame will be sent to the
@@ -114,35 +142,33 @@ It is strongly recommended that the user look into the data sheet before doing
 any flow control configuration. By default, the flow control on 10G is disabled.
 the flow control for 1G is enabled.
 
-Validate the NIC can deal with the pause frame.
+Validate the NIC can deal with the pause frame(``rx on``).
 Configure the traffic generator to send out large amount of pause frames, this
 will cause the NIC to disable / slow down the packet transmission according to
 the pause time. Once the traffic generator stop sending the pause frame, the NIC
 will restore the packet transmission to the expected rate.
 
+Subcase: test_perf_flowctrl_on_pause_fwd_off
+--------------------------------------------
+Enable link flow control and Disable PAUSE frame forwarding::
 
-Test Case: test_perf_flowctrl_on_pause_fwd_off
-==============================================
-::
-
-  testpmd> set flowctrl rx on tx on high_water low_water pause_time
+  testpmd> set flow_ctrl rx on tx on high_water low_water pause_time
   send_xon mac_ctrl_frame_fwd off autoneg on port_id
 
-Validate same behavior as test_perf_flowctrl_on_pause_fwd_on
-
+Validate same behavior as ``test_perf_flowctrl_on_pause_fwd_on``
 
-Test Case: test_perf_flowctrl_rx_on
-===================================
-::
+Subcase: test_perf_flowctrl_rx_on
+---------------------------------
+Enable only rx link flow control::
 
-  testpmd> set flowctrl rx on tx on high_water low_water pause_time
+  testpmd> set flowctrl rx on tx off high_water low_water pause_time
   send_xon mac_ctrl_frame_fwd off autoneg on port_id
 
-Validate same behavior as test_perf_flowctrl_on_pause_fwd_on
+Validate the NIC can deal with the pause frame(``rx on``).
 
-
-Test Case: test_perf_flowctrl_off_pause_fwd_off
-===============================================
+Subcase: test_perf_flowctrl_off_pause_fwd_off
+---------------------------------------------
+Disable both link flow control and PAUSE frame forwarding.
 This is the default mode for 10G PMD, by default, testpmd is running on this mode.
 no need to execute any command::
 
@@ -154,20 +180,139 @@ enough. Packet loss can be observed.
 Validate the NIC will not slow down the packet transmission after receiving the
 pause frame.
 
-Test Case: test_perf_flowctrl_off_pause_fwd_on
-==============================================
-::
+Subcase: test_perf_flowctrl_off_pause_fwd_on
+--------------------------------------------
+Disable link flow control and enable PAUSE frame forwarding::
 
   testpmd> set flowctrl rx off tx off high_water low_water pause_time
   send_xon mac_ctrl_frame_fwd on autoneg on port_id
 
-Validate same behavior as test_perf_flowctrl_off_pause_fwd_off
+Validate same behavior as ``test_perf_flowctrl_off_pause_fwd_off``
 
-Test Case: test_perf_flowctrl_tx_on
-===================================
-::
+Subcase: test_perf_flowctrl_tx_on
+---------------------------------
+Enable only tx link flow control::
 
   testpmd> set flowctrl rx off tx on high_water low_water pause_time
   send_xon mac_ctrl_frame_fwd off autoneg on port_id
 
 Validate same behavior as test_perf_flowctrl_on_pause_fwd_off
+
+Subcase: test_perf_flowctrl_on_port_stop_start
+----------------------------------------------
+Link flow control setting still working after port stop/start.
+
+* ``enable`` Link flow control::
+
+    testpmd> set flow_ctrl rx on tx on high_water low_water pause_time
+    send_xon mac_ctrl_frame_fwd off autoneg on port_id
+
+  validate behavior same as ``test_perf_flowctrl_on_pause_fwd_off``.
+
+  Stop and start port::
+
+    testpmd> stop
+    testpmd> port stop 0
+    testpmd> port start 0
+    testpmd> start
+
+  validate behavior same as ``test_perf_flowctrl_on_pause_fwd_off``.
+
+
+* ``disable`` Link flow control::
+
+    testpmd> set flowctrl rx off tx off high_water low_water pause_time
+    send_xon mac_ctrl_frame_fwd off autoneg on port_id
+
+  validate behavior same as ``test_perf_flowctrl_off_pause_fwd_off``.
+
+  Stop and start port::
+
+    testpmd> stop
+    testpmd> port stop 0
+    testpmd> port start 0
+    testpmd> start
+
+  validate behavior same as ``test_perf_flowctrl_off_pause_fwd_off``.
+
+
+Test Case: MAC Control Frame Forwarding
+=======================================
+This case series foucs on ``MAC Control Frame Forwarding``, no requirment of
+high-speed packets, it's very friendship to use scapy as packet generator.
+
+Subcase: test_flowctrl_off_pause_fwd_off
+----------------------------------------
+PAUSE Frames will not be received by testpmd while Flow Control disabled and
+MAC Control Frame Forwarding disabled::
+
+  testpmd> set flow_ctrl rx off tx off 300 50 10 1 mac_ctrl_frame_fwd off autoneg off 0
+
+Send PAUSE packets to DUT with below options:
+
+* Regular frame (correct src and dst mac addresses and opcode)
+* Wrong source frame (wrong src, correct and dst mac address and correct opcode)
+* Wrong opcode frame (correct src and dst mac address and wrong opcode)
+* Wrong destination frame (correct src mac and opcode, wrong dst mac address)
+
+Validate no packet received by testpmd according to ``show port stats all``
+
+Subcase: test_flowctrl_off_pause_fwd_on
+---------------------------------------
+All PAUSE Frames will be forwarded by testpmd while Flow Control disabled and
+MAC Control Frame Forwarding enabled::
+
+  testpmd> set flow_ctrl rx off tx off 300 50 10 1 mac_ctrl_frame_fwd on autoneg off 0
+
+Send PAUSE packets to DUT with same options as ``test_flowctrl_off_pause_fwd_off``
+
+Validate port statistic match below table
+
+.. table::
+
+   +-------+-----------------+---------------+
+   |   #   | Frames          | Received      |
+   +=======+=================+===============+
+   |   0   | Regular frame   | Yes           |
+   +-------+-----------------+---------------+
+   |   1   | Wrong src mac   | Yes           |
+   +-------+-----------------+---------------+
+   |   2   | Wrong opcode    | Yes           |
+   +-------+-----------------+---------------+
+   |   3   | Wrong dst mac   | Yes           |
+   +-------+-----------------+---------------+
+
+Subcase: test_pause_fwd_port_stop_start
+---------------------------------------
+MAC Control Frame Forwarding setting still working after port stop/start.
+
+* ``enable`` MAC Control Frame Forwarding, and validate packets are received::
+
+    testpmd> set flow_ctrl mac_ctrl_frame_fwd on 0
+
+  Send regular PAUSE packets to DUT, and validate packets are received.
+
+  Stop and start port::
+
+    testpmd> stop
+    testpmd> port stop 0
+    testpmd> port start 0
+    testpmd> start
+
+  Send regular PAUSE packets to DUT, and validate packets are received.
+
+
+* ``disable`` MAC Control Frame Forwarding, and validate ``no`` packets are received::
+
+    testpmd> set flow_ctrl mac_ctrl_frame_fwd off 0
+
+  Send regular PAUSE packets to DUT, and validate ``no`` packets are received.
+
+  Stop and start port::
+
+    testpmd> stop
+    testpmd> port stop 0
+    testpmd> port start 0
+    testpmd> start
+
+  Send regular PAUSE packets to DUT, and validate ``no`` packets are received.
-- 
1.8.3.1


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

* Re: [dts] [PATCH v2] test_plan/link_flow_ctrl: new cases for port stop/start
  2020-06-19 15:21 ` [dts] [PATCH v2] " Lijuan Tu
@ 2020-07-01  5:54   ` Tu, Lijuan
  0 siblings, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2020-07-01  5:54 UTC (permalink / raw)
  To: Tu, Lijuan; +Cc: dts

Applied, thanks

> -----Original Message-----
> From: Tu, Lijuan <lijuan.tu@intel.com>
> Sent: 2020年6月19日 23:22
> To: Tu, Lijuan <lijuan.tu@intel.com>
> Cc: dts@dpdk.org
> Subject: [PATCH v2] test_plan/link_flow_ctrl: new cases for port stop/start
> 
> * add new cases (also not inclued in script):
>   - test_pause_fwd_port_stop_start
>   - test_perf_flowctrl_on_port_stop_start
> 
> * add missing cases (already inclued in script):
>   - test_flowctrl_off_pause_fwd_on
>   - test_flowctrl_off_pause_fwd_off
> 
> * more description
> * more organized
> 
> Signed-off-by: Lijuan Tu <lijuan.tu@intel.com>
> ---
>  test_plans/link_flowctrl_test_plan.rst | 213 +++++++++++++++++++++++++++---
> ---
>  1 file changed, 179 insertions(+), 34 deletions(-)
> 
> diff --git a/test_plans/link_flowctrl_test_plan.rst
> b/test_plans/link_flowctrl_test_plan.rst
> index d028e67..d3bd8af 100644
> --- a/test_plans/link_flowctrl_test_plan.rst
> +++ b/test_plans/link_flowctrl_test_plan.rst
> @@ -52,13 +52,37 @@ MAC Control Frame Forwarding consists in:
>  - When Flow Control and MAC Control Frame Forwarding are enabled the
> PAUSE
>    frames will be passed to the host and can be handled by testpmd.
> 
> -Note: Priority flow control is not included in this test plan.
> +.. note::
> 
> -Note: the high_water, low_water, pause_time, send_xon are configured into
> the -NIC register. It is not necessary to validate the accuracy of these
> parameters.
> -And what change it can cause. The port_id is used to indicate the NIC to be -
> configured. In certain case, a system can contain multiple NIC. However the NIC
> -need not be configured multiple times.
> +   Priority flow control is not included in this test plan.
> +
> +Configuration Functions in testpmd:
> +
> +  Set the link flow control parameter on a port::
> +
> +    testpmd> set flow_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \
> +           (pause_time) (send_xon) mac_ctrl_frame_fwd (on|off) \
> +           autoneg (on|off) (port_id)
> +
> +  * ``high_water`` (integer): High threshold value to trigger XOFF.
> +
> +  * ``low_water`` (integer): Low threshold value to trigger XON.
> +
> +  * ``pause_time`` (integer): Pause quota in the Pause frame.
> +
> +  * ``send_xon`` (0/1): Send XON frame.
> +
> +  * ``mac_ctrl_frame_fwd``: Enable receiving MAC control frames.
> +
> +  * ``autoneg``: Change the auto-negotiation parameter.
> +
> +  .. note::
> +
> +     the high_water, low_water, pause_time, send_xon are configured into the
> +     NIC register. It is not necessary to validate the accuracy of these parameters.
> +     And what change it can cause. The port_id is used to indicate the NIC to be
> +     configured. In certain case, a system can contain multiple NIC. However the
> NIC
> +     need not be configured multiple times.
> 
> 
>  Prerequisites
> @@ -81,12 +105,16 @@ to the device under test::
>     modprobe vfio-pci
>     usertools/dpdk-devbind.py --bind=vfio-pci device_bus_id
> 
> -Test Case: test_perf_flowctrl_on_pause_fwd_on
> -=============================================
> 
> -::
> +Test Case: Ethernet link flow control
> +=====================================
> +This case series are focus on ``Ethernet link flow control features``, requires a
> high-speed packet generator, such as ixia.
> 
> -  testpmd> set flowctrl rx on tx on high_water low_water pause_time
> +Subcase: test_perf_flowctrl_on_pause_fwd_on
> +-------------------------------------------
> +Enable both link flow control and PAUSE frame forwarding::
> +
> +  testpmd> set flow_ctrl rx on tx on high_water low_water pause_time
>    send_xon mac_ctrl_frame_fwd on autoneg on port_id
> 
>  Setup the ``csum`` forwarding mode::
> @@ -104,7 +132,7 @@ Start the packet forwarding::
>      TX queues=1 - TX desc=512 - TX free threshold=0
>      TX threshold registers: pthresh=32 hthresh=8 wthresh=8
> 
> -Validate the NIC can generate the pause frame?
> +Validate the NIC can generate the pause frame(``tx on``).
>  Configure the traffic generator to send IPv4/UDP packet at the length of 66Byte
> at the line speed (10G). Because the 66Byte packet cannot reach line rate when
> running with testpmd, so it is expected that the pause frame will be sent to the
> @@ -114,35 +142,33 @@ It is strongly recommended that the user look into the
> data sheet before doing  any flow control configuration. By default, the flow
> control on 10G is disabled.
>  the flow control for 1G is enabled.
> 
> -Validate the NIC can deal with the pause frame.
> +Validate the NIC can deal with the pause frame(``rx on``).
>  Configure the traffic generator to send out large amount of pause frames, this
> will cause the NIC to disable / slow down the packet transmission according to
> the pause time. Once the traffic generator stop sending the pause frame, the
> NIC  will restore the packet transmission to the expected rate.
> 
> +Subcase: test_perf_flowctrl_on_pause_fwd_off
> +--------------------------------------------
> +Enable link flow control and Disable PAUSE frame forwarding::
> 
> -Test Case: test_perf_flowctrl_on_pause_fwd_off
> -==============================================
> -::
> -
> -  testpmd> set flowctrl rx on tx on high_water low_water pause_time
> +  testpmd> set flow_ctrl rx on tx on high_water low_water pause_time
>    send_xon mac_ctrl_frame_fwd off autoneg on port_id
> 
> -Validate same behavior as test_perf_flowctrl_on_pause_fwd_on
> -
> +Validate same behavior as ``test_perf_flowctrl_on_pause_fwd_on``
> 
> -Test Case: test_perf_flowctrl_rx_on
> -===================================
> -::
> +Subcase: test_perf_flowctrl_rx_on
> +---------------------------------
> +Enable only rx link flow control::
> 
> -  testpmd> set flowctrl rx on tx on high_water low_water pause_time
> +  testpmd> set flowctrl rx on tx off high_water low_water pause_time
>    send_xon mac_ctrl_frame_fwd off autoneg on port_id
> 
> -Validate same behavior as test_perf_flowctrl_on_pause_fwd_on
> +Validate the NIC can deal with the pause frame(``rx on``).
> 
> -
> -Test Case: test_perf_flowctrl_off_pause_fwd_off
> -===============================================
> +Subcase: test_perf_flowctrl_off_pause_fwd_off
> +---------------------------------------------
> +Disable both link flow control and PAUSE frame forwarding.
>  This is the default mode for 10G PMD, by default, testpmd is running on this
> mode.
>  no need to execute any command::
> 
> @@ -154,20 +180,139 @@ enough. Packet loss can be observed.
>  Validate the NIC will not slow down the packet transmission after receiving the
> pause frame.
> 
> -Test Case: test_perf_flowctrl_off_pause_fwd_on
> -==============================================
> -::
> +Subcase: test_perf_flowctrl_off_pause_fwd_on
> +--------------------------------------------
> +Disable link flow control and enable PAUSE frame forwarding::
> 
>    testpmd> set flowctrl rx off tx off high_water low_water pause_time
>    send_xon mac_ctrl_frame_fwd on autoneg on port_id
> 
> -Validate same behavior as test_perf_flowctrl_off_pause_fwd_off
> +Validate same behavior as ``test_perf_flowctrl_off_pause_fwd_off``
> 
> -Test Case: test_perf_flowctrl_tx_on
> -===================================
> -::
> +Subcase: test_perf_flowctrl_tx_on
> +---------------------------------
> +Enable only tx link flow control::
> 
>    testpmd> set flowctrl rx off tx on high_water low_water pause_time
>    send_xon mac_ctrl_frame_fwd off autoneg on port_id
> 
>  Validate same behavior as test_perf_flowctrl_on_pause_fwd_off
> +
> +Subcase: test_perf_flowctrl_on_port_stop_start
> +----------------------------------------------
> +Link flow control setting still working after port stop/start.
> +
> +* ``enable`` Link flow control::
> +
> +    testpmd> set flow_ctrl rx on tx on high_water low_water pause_time
> +    send_xon mac_ctrl_frame_fwd off autoneg on port_id
> +
> +  validate behavior same as ``test_perf_flowctrl_on_pause_fwd_off``.
> +
> +  Stop and start port::
> +
> +    testpmd> stop
> +    testpmd> port stop 0
> +    testpmd> port start 0
> +    testpmd> start
> +
> +  validate behavior same as ``test_perf_flowctrl_on_pause_fwd_off``.
> +
> +
> +* ``disable`` Link flow control::
> +
> +    testpmd> set flowctrl rx off tx off high_water low_water pause_time
> +    send_xon mac_ctrl_frame_fwd off autoneg on port_id
> +
> +  validate behavior same as ``test_perf_flowctrl_off_pause_fwd_off``.
> +
> +  Stop and start port::
> +
> +    testpmd> stop
> +    testpmd> port stop 0
> +    testpmd> port start 0
> +    testpmd> start
> +
> +  validate behavior same as ``test_perf_flowctrl_off_pause_fwd_off``.
> +
> +
> +Test Case: MAC Control Frame Forwarding
> +=======================================
> +This case series foucs on ``MAC Control Frame Forwarding``, no
> +requirment of high-speed packets, it's very friendship to use scapy as packet
> generator.
> +
> +Subcase: test_flowctrl_off_pause_fwd_off
> +----------------------------------------
> +PAUSE Frames will not be received by testpmd while Flow Control
> +disabled and MAC Control Frame Forwarding disabled::
> +
> +  testpmd> set flow_ctrl rx off tx off 300 50 10 1 mac_ctrl_frame_fwd
> + off autoneg off 0
> +
> +Send PAUSE packets to DUT with below options:
> +
> +* Regular frame (correct src and dst mac addresses and opcode)
> +* Wrong source frame (wrong src, correct and dst mac address and
> +correct opcode)
> +* Wrong opcode frame (correct src and dst mac address and wrong opcode)
> +* Wrong destination frame (correct src mac and opcode, wrong dst mac
> +address)
> +
> +Validate no packet received by testpmd according to ``show port stats
> +all``
> +
> +Subcase: test_flowctrl_off_pause_fwd_on
> +---------------------------------------
> +All PAUSE Frames will be forwarded by testpmd while Flow Control
> +disabled and MAC Control Frame Forwarding enabled::
> +
> +  testpmd> set flow_ctrl rx off tx off 300 50 10 1 mac_ctrl_frame_fwd
> + on autoneg off 0
> +
> +Send PAUSE packets to DUT with same options as
> +``test_flowctrl_off_pause_fwd_off``
> +
> +Validate port statistic match below table
> +
> +.. table::
> +
> +   +-------+-----------------+---------------+
> +   |   #   | Frames          | Received      |
> +   +=======+=================+===============+
> +   |   0   | Regular frame   | Yes           |
> +   +-------+-----------------+---------------+
> +   |   1   | Wrong src mac   | Yes           |
> +   +-------+-----------------+---------------+
> +   |   2   | Wrong opcode    | Yes           |
> +   +-------+-----------------+---------------+
> +   |   3   | Wrong dst mac   | Yes           |
> +   +-------+-----------------+---------------+
> +
> +Subcase: test_pause_fwd_port_stop_start
> +---------------------------------------
> +MAC Control Frame Forwarding setting still working after port stop/start.
> +
> +* ``enable`` MAC Control Frame Forwarding, and validate packets are received::
> +
> +    testpmd> set flow_ctrl mac_ctrl_frame_fwd on 0
> +
> +  Send regular PAUSE packets to DUT, and validate packets are received.
> +
> +  Stop and start port::
> +
> +    testpmd> stop
> +    testpmd> port stop 0
> +    testpmd> port start 0
> +    testpmd> start
> +
> +  Send regular PAUSE packets to DUT, and validate packets are received.
> +
> +
> +* ``disable`` MAC Control Frame Forwarding, and validate ``no`` packets are
> received::
> +
> +    testpmd> set flow_ctrl mac_ctrl_frame_fwd off 0
> +
> +  Send regular PAUSE packets to DUT, and validate ``no`` packets are received.
> +
> +  Stop and start port::
> +
> +    testpmd> stop
> +    testpmd> port stop 0
> +    testpmd> port start 0
> +    testpmd> start
> +
> +  Send regular PAUSE packets to DUT, and validate ``no`` packets are received.
> --
> 1.8.3.1


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

end of thread, other threads:[~2020-07-01  5:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 16:45 [dts] [PATCH] test_plan/link_flow_ctrl: new cases for port stop/start Lijuan Tu
2020-06-19 15:21 ` [dts] [PATCH v2] " Lijuan Tu
2020-07-01  5:54   ` Tu, Lijuan

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