From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 15515A0096 for ; Fri, 12 Apr 2019 04:14:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 099714D27; Fri, 12 Apr 2019 04:14:47 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 638B429AC for ; Fri, 12 Apr 2019 04:14:45 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 19:14:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,339,1549958400"; d="scan'208";a="150162604" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.176.135]) by orsmga002.jf.intel.com with ESMTP; 11 Apr 2019 19:14:42 -0700 From: Jianwei Mei To: dts@dpdk.org Cc: Jianwei Mei Date: Fri, 12 Apr 2019 10:18:56 +0800 Message-Id: <1555035536-20289-1-git-send-email-jianweix.mei@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V4] tests/etag: add vf driver vfio-pci 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" add vf driver vfio-pci Signed-off-by: Jianwei Mei --- tests/TestSuite_etag.py | 45 ++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/tests/TestSuite_etag.py b/tests/TestSuite_etag.py index 7cf93eb..fd855de 100644 --- a/tests/TestSuite_etag.py +++ b/tests/TestSuite_etag.py @@ -33,27 +33,24 @@ DPDK Test suite. ''' - import re import time import sys - import utils from qemu_kvm import QEMUKvm from test_case import TestCase from pmd_output import PmdOutput from exception import VerifyFailure - from scapy.utils import rdpcap - from packet import Packet VM_CORES_MASK = 'all' class TestEtag(TestCase): + supported_vf_driver = ['pci-stub', 'vfio-pci'] def set_up_all(self): self.dut_ports = self.dut.get_ports(self.nic) - self.verify(self.nic in ['sagepond'], '802.1BR only support by sagepond') + self.verify(self.nic in ['sagepond','sageville'], '802.1BR only support by sagepond and sageville') self.verify(len(self.dut_ports) >= 1, 'Insufficient ports') self.src_intf = self.tester.get_interface(self.tester.get_local_port(0)) self.src_mac = self.tester.get_mac(self.tester.get_local_port(0)) @@ -78,25 +75,45 @@ class TestEtag(TestCase): self.dut.generate_sriov_vfs_by_port(self.used_dut_port_0, 2, driver=driver) self.sriov_vfs_port_0 = self.dut.ports_info[self.used_dut_port_0]['vfs_port'] + # set vf assign method and vf driver + self.vf_driver = self.get_suite_cfg()['vf_driver'] + if self.vf_driver is None: + self.vf_driver = 'pci-stub' + self.verify(self.vf_driver in self.supported_vf_driver, "Unspported vf driver") + if self.vf_driver == 'pci-stub': + self.vf_assign_method = 'pci-assign' + else: + self.vf_assign_method = 'vfio-pci' + self.dut.send_expect('modprobe vfio-pci', '#') + try: for port in self.sriov_vfs_port_0: - port.bind_driver('pci-stub') + port.bind_driver(self.vf_driver) time.sleep(1) vf0_prop = {'opt_host': self.sriov_vfs_port_0[0].pci} vf1_prop = {'opt_host': self.sriov_vfs_port_0[1].pci} - # start testpmd without the two VFs on the host - self.host_testpmd = PmdOutput(self.dut) - eal_param = '-b %(vf0)s -b %(vf1)s' % {'vf0': self.sriov_vfs_port_0[0].pci, + if driver == 'igb_uio': + # start testpmd without the two VFs on the host + self.host_testpmd = PmdOutput(self.dut) + eal_param = '-b %(vf0)s -b %(vf1)s' % {'vf0': self.sriov_vfs_port_0[0].pci, + 'vf1': self.sriov_vfs_port_0[1].pci} + if (self.nic in ["niantic", "sageville", "sagepond"]): + self.host_testpmd.start_testpmd("1S/2C/2T", "--txq=4 --rxq=4 ", eal_param=eal_param) + else: + self.host_testpmd.start_testpmd("1S/2C/2T", "", eal_param=eal_param) + else: + # start testpmd without the two VFs on the host + self.host_testpmd = PmdOutput(self.dut) + eal_param = '-b %(vf0)s -b %(vf1)s' % {'vf0': self.sriov_vfs_port_0[0].pci, 'vf1': self.sriov_vfs_port_0[1].pci} - - self.preset_host_testpmd('1S/2C/2T', eal_param) + self.preset_host_testpmd('1S/2C/2T', eal_param) # set up VM0 ENV self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_etag') - self.vm0.set_vm_device(driver='pci-assign', **vf0_prop) - self.vm0.set_vm_device(driver='pci-assign', **vf1_prop) + self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prop) + self.vm0.set_vm_device(driver=self.vf_assign_method, **vf1_prop) self.vm_dut_0 = self.vm0.start() if self.vm_dut_0 is None: raise Exception('Set up VM0 ENV failed!') @@ -290,7 +307,7 @@ class TestEtag(TestCase): else: # Same E-tag forwarding to VF0, Send 802.1BR packet with broadcast mac and # check packet only received on VF0 or VF1 - host_cmds = [['E-tag set filter add e-tag-id 1000 dst-pool %d port 0'%test_type[-1:]], + host_cmds = [['E-tag set filter add e-tag-id 1000 dst-pool %d port 0'% int(test_type[-1:])], ['set fwd rxonly'], ['set verbose 1'], ['start']] -- 2.17.2