test suite reviews and discussions
 help / color / mirror / Atom feed
From: yufengmx <yufengx.mo@intel.com>
To: dts@dpdk.org, lei.a.yao@intel.com
Cc: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V4 2/3] tests/malicious_driver_event_indication: update test plan
Date: Tue, 26 May 2020 14:26:00 +0800	[thread overview]
Message-ID: <20200526062601.17135-3-yufengx.mo@intel.com> (raw)
In-Reply-To: <20200526062601.17135-1-yufengx.mo@intel.com>


Malicious driver event indication process in FVL PF driver.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 ...ious_driver_event_indication_test_plan.rst | 96 +++++++++++++++++++
 1 file changed, 96 insertions(+)
 create mode 100644 test_plans/malicious_driver_event_indication_test_plan.rst

diff --git a/test_plans/malicious_driver_event_indication_test_plan.rst b/test_plans/malicious_driver_event_indication_test_plan.rst
new file mode 100644
index 0000000..dfeb783
--- /dev/null
+++ b/test_plans/malicious_driver_event_indication_test_plan.rst
@@ -0,0 +1,96 @@
+.. Copyright (c) <2020>, Intel Corporation
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   - Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+   - Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+
+   - Neither the name of Intel Corporation nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+   COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+   OF THE POSSIBILITY OF SUCH DAMAGE.
+
+==========================================================
+Malicious driver event indication process in FVL PF driver
+==========================================================
+
+Need modify the testpmd APP to generate invalid packets in tx only mode
+
+.. code-block:: console
+
+    diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
+    index 3caf281cb..448aab715 100644
+    --- a/app/test-pmd/txonly.c
+    +++ b/app/test-pmd/txonly.c
+    @@ -299,6 +299,11 @@ pkt_burst_transmit(struct fwd_stream *fs)
+            if (nb_pkt == 0)
+                    return;
+    
+    +        for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++){
+    +                 pkts_burst[nb_pkt]->data_len = 15;
+    +         }
+    +
+    +
+            nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_pkt);
+            /*
+             * Retry if necessary
+
+
+Test Case1:  Check log output when malicious driver events is detected
+======================================================================
+1. Generate i40e VF when PF is binded to igb_uio driver
+    echo 1 > /sys/bus/pci/devices/0000\:18\:00.1/max_vfs
+
+2. Launch PF by testpmd
+    ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x03 -n 4 --file-prefix=test1 -w [pci of PF] -- -i
+     
+3. Launch VF by testpmd
+    ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x03 -n 4 --file-prefix=lei1 -w [pci of VF] -- -i
+    > set fwd txonly
+    > start
+    
+4. Check the PF can detect the VF's unexpected behavior and output warning log
+    testpmd>
+    i40e_dev_alarm_handler(): ICR0: malicious programming detected
+    i40e_handle_mdd_event(): Malicious Driver Detection event 0x00 on TX queue 65 PF number 0x01 VF number 0x40 device 0000:18:00.1
+    i40e_handle_mdd_event(): TX driver issue detected on PF
+    i40e_handle_mdd_event(): TX driver issue detected on VF 0 1times
+
+
+Test Case2:  Check the event counter number for malicious driver events
+=======================================================================
+1. Generate i40e VF when PF is binded to igb_uio driver
+    echo 1 > /sys/bus/pci/devices/0000\:18\:00.1/max_vfs
+
+2. Launch PF by testpmd
+    ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x03 -n 4 --file-prefix=test1 -w [pci of PF] -- -i
+
+3. launch VF by testpmd and start txonly mode 3 times:
+    repeat following step 3 times
+    ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x03 -n 4 --file-prefix=lei1 -w [pci of VF] -- -i
+    > set fwd txonly
+    > start
+    > quit
+
+4. Check the PF can detect the malicious driver events number directly in the log:
+   i40e_handle_mdd_event(): TX driver issue detected on VF 0 3times
\ No newline at end of file
-- 
2.21.0


  parent reply	other threads:[~2020-05-26  6:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26  6:25 [dts] [PATCH V4 0/3] tests/malicious_driver_event_indication: upload test plan and automation script yufengmx
2020-05-26  6:25 ` [dts] [PATCH V4 1/3] tests/malicious_driver_event_indication: upload automation yufengmx
2020-05-26  6:26 ` yufengmx [this message]
2020-05-26  6:26 ` [dts] [PATCH V4 3/3] tests/malicious_driver_event_indication: add test plan yufengmx
2020-06-01  3:13 ` [dts] [PATCH V4 0/3] tests/malicious_driver_event_indication: upload test plan and automation script Tu, Lijuan

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=20200526062601.17135-3-yufengx.mo@intel.com \
    --to=yufengx.mo@intel.com \
    --cc=dts@dpdk.org \
    --cc=lei.a.yao@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).