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 101C4A04A4; Tue, 26 May 2020 08:24:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F12C41D95B; Tue, 26 May 2020 08:24:56 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 51BA91D95B for ; Tue, 26 May 2020 08:24:55 +0200 (CEST) IronPort-SDR: NvqmNDTsvk/fm7PBO+BSk4otZaE00cZGyyKaM1yTW1T5EWYCxvbqbJAgxYr5+oeBfWHCEUtg9S QLE+9BRfpQhQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2020 23:24:54 -0700 IronPort-SDR: qd7z+FnKwBdYYQnm6NV8W3Vd21rvdlFKwMRWbFPV62M5bOjCUGbaTShz3UKZYO0D9uw7b8QhZn Pgt4cXmk7Gvw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,436,1583222400"; d="scan'208";a="255074763" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.208]) by fmsmga007.fm.intel.com with ESMTP; 25 May 2020 23:24:53 -0700 From: yufengmx To: dts@dpdk.org, lei.a.yao@intel.com Cc: yufengmx Date: Tue, 26 May 2020 14:26:00 +0800 Message-Id: <20200526062601.17135-3-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200526062601.17135-1-yufengx.mo@intel.com> References: <20200526062601.17135-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V4 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..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