From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 38EB3A00C5; Thu, 30 Apr 2020 10:53:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2A7F11D9C8; Thu, 30 Apr 2020 10:53:22 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 84A721D967 for ; Thu, 30 Apr 2020 10:53:20 +0200 (CEST) IronPort-SDR: ZtOA8e24FMD1Xt6AAD0+uEqcpNONdp8ecM04Nlre/HCHyc8+KAT/VCvUkzVKzt03wLrl70rJR/ Azch4WP+IsAQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2020 01:53:19 -0700 IronPort-SDR: Mhi1U7DVZ9Z7a5iws+YVGZjgj/q8mSo6e7Yt4stcuNOpdPBEGN6LSldSfTAdsRGSROPE8IlElH BFtOH8XUvh9w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,334,1583222400"; d="scan'208";a="368076315" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.222]) by fmsmga001.fm.intel.com with ESMTP; 30 Apr 2020 01:53:18 -0700 From: yufengmx To: dts@dpdk.org, lei.a.yao@intel.com Cc: yufengmx Date: Thu, 30 Apr 2020 16:55:17 +0800 Message-Id: <20200430085518.31075-3-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200430085518.31075-1-yufengx.mo@intel.com> References: <20200430085518.31075-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V2 2/3] tests/malicious_driver_event_indication: update test plan X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Malicious driver event indication process in FVL PF driver. Signed-off-by: yufengmx --- ...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..2813df8 --- /dev/null +++ b/test_plans/malicious_driver_event_indication_test_plan.rst @@ -0,0 +1,96 @@ +.. Copyright (c) <2019>, 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 [pic of PF] -- -i + +3. Launch VF by testpmd + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x03 -n 4 --file-prefix=lei1 -w [pic 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 [pic 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 [pic 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