From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id AD6E8C4C2 for ; Mon, 29 Jun 2015 07:17:27 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 28 Jun 2015 22:17:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,696,1427785200"; d="scan'208";a="596475485" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 28 Jun 2015 22:17:26 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t5T5HNUf019681; Mon, 29 Jun 2015 13:17:23 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t5T5HL09028405; Mon, 29 Jun 2015 13:17:23 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t5T5HLdF028401; Mon, 29 Jun 2015 13:17:21 +0800 From: Yong Liu To: dts@dpdk.org Date: Mon, 29 Jun 2015 13:17:14 +0800 Message-Id: <1435555035-28355-3-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1435555035-28355-1-git-send-email-yong.liu@intel.com> References: <1435555035-28355-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH 2/3] Optimize virtual machine port map routine 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: , X-List-Received-Date: Mon, 29 Jun 2015 05:17:28 -0000 From: Marvin Liu Skip ping from those devices which on the same PF devices. Signed-off-by: Marvin Liu diff --git a/framework/virt_dut.py b/framework/virt_dut.py index 79ecc2a..2edbf6f 100644 --- a/framework/virt_dut.py +++ b/framework/virt_dut.py @@ -285,29 +285,32 @@ class VirtDut(DPDKdut): hits = [False] * len(self.tester.ports_info) - for dutPort in range(nrPorts): - peer = self.get_peer_pci(dutPort) + for vmPort in range(nrPorts): + vmpci = self.ports_info[vmPort]['pci'] + peer = self.get_peer_pci(vmPort) # if peer pci configured if peer is not None: for remotePort in range(len(self.tester.ports_info)): if self.tester.ports_info[remotePort]['pci'] == peer: hits[remotePort] = True - self.ports_map[dutPort] = remotePort + self.ports_map[vmPort] = remotePort break - if self.ports_map[dutPort] == -1: + if self.ports_map[vmPort] == -1: self.logger.error("CONFIGURED TESTER PORT CANNOT FOUND!!!") else: continue # skip ping6 map - if hasattr(self.hyper, 'pt_devices'): - hostpci = self.hyper.pt_devices[dutPort] - netdev = get_netdev(self.host_dut, hostpci) + # strip pci address on host for pass-through device + hostpci = 'N/A' + for pci_map in self.hyper.pci_maps: + if vmpci == pci_map['guestpci']: + hostpci = pci_map['hostpci'] + break # auto ping port map for remotePort in range(len(self.tester.ports_info)): # for two vfs connected to same tester port - # can't skip those teste ports even have hits - # need skip ping self vf port + # need skip ping from devices on same pf device remotepci = self.tester.ports_info[remotePort]['pci'] remoteport = self.tester.ports_info[remotePort]['port'] vfs = [] @@ -315,21 +318,21 @@ class VirtDut(DPDKdut): host_ip = self.crb['IP'].split(':')[0] if self.crb['tester IP'] == host_ip: vfs = remoteport.get_sriov_vfs_pci() - # if hostpci is vf of tester port - if netdev.pci in vfs: - print dts.RED("Skip ping from PF device") - continue + # if hostpci is vf of tester port + if hostpci == remotepci or hostpci in vfs: + print dts.RED("Skip ping from same PF device") + continue - ipv6 = self.get_ipv6_address(dutPort) + ipv6 = self.get_ipv6_address(vmPort) if ipv6 == "Not connected": continue out = self.tester.send_ping6( - remotePort, ipv6, self.get_mac_address(dutPort)) + remotePort, ipv6, self.get_mac_address(vmPort)) if ('64 bytes from' in out): self.logger.info( - "PORT MAP: [dut %d: tester %d]" % (dutPort, remotePort)) - self.ports_map[dutPort] = remotePort + "PORT MAP: [dut %d: tester %d]" % (vmPort, remotePort)) + self.ports_map[vmPort] = remotePort hits[remotePort] = True continue -- 1.9.3