From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id BD84DB591 for ; Mon, 16 Feb 2015 04:08:01 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 15 Feb 2015 19:08:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,584,1418112000"; d="scan'208";a="666820281" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 15 Feb 2015 19:07:58 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t1G37vEU022987; Mon, 16 Feb 2015 11:07:57 +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 t1G37s3s001325; Mon, 16 Feb 2015 11:07:56 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t1G37sQg001321; Mon, 16 Feb 2015 11:07:54 +0800 From: Yong Liu To: dts@dpdk.org Date: Mon, 16 Feb 2015 11:07:45 +0800 Message-Id: <1424056068-1156-3-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1424056068-1156-1-git-send-email-yong.liu@intel.com> References: <1423728550-14792-1-git-send-email-yong.liu@intel.com> <1424056068-1156-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH V3 2/5] framework: support configure IXIA port as tester peer port 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, 16 Feb 2015 03:08:02 -0000 Now we can specify DUT's IXIA port id in port configuration file. Now can run performance validation with only one DUT. Signed-off-by: Marvinliu diff --git a/conf/ports.cfg b/conf/ports.cfg index eb2cb34..43cab27 100644 --- a/conf/ports.cfg +++ b/conf/ports.cfg @@ -3,7 +3,9 @@ # ports= # pci=Pci BDF,intf=Kernel interface; # pci=Pci BDF,mac=Mac address,peer=Tester Pci BDF,numa=Port Numa +# pci=Pci BDF,peer=IXIA:card.port [DUT IP] -ports = +ports = pci=XX:XX.X,intf=eth0; - pci=YY:YY.Y,mac=XX:XX:XX:XX:XX:XX,peer=ZZ:ZZ.Z,numa=0 + pci=YY:YY.Y,mac=XX:XX:XX:XX:XX:XX,peer=ZZ:ZZ.Z,numa=0; + pci=ZZ:ZZ.Y,peer=IXIA:X.Y diff --git a/framework/etgen.py b/framework/etgen.py index f2da4ab..16df3f9 100644 --- a/framework/etgen.py +++ b/framework/etgen.py @@ -112,7 +112,7 @@ class SoftwarePacketGenerator(): self.tester.send_expect("stop all", "Pktgen>") self.tester.send_expect("quit", "# ") - self.tester.kill_all() + self.tester.kill_all(killall=True) self.tester.restore_interfaces() return rx_bps, tx_bps, rx_pps @@ -385,13 +385,13 @@ class IxiaPacketGenerator(SSHConnection): string.join(['[list %d %d %d]' % (self.chasId, item['card'], item['port']) for item in pList], ' ')) - def send_ping6(self, intf, mac, ipv6): + def send_ping6(self, pci, mac, ipv6): """ Send ping6 packet from IXIA ports. """ self.send_expect("source ./ixTcl1.0/ixiaPing6.tcl", "% ") out = self.send_expect('ping6 "%s" "%s" %d %d %d' % - (self.ipv6_to_tcl_format(ipv6), self.macToTclFormat(mac), self.chasId, self.interface_to_port(intf)['card'], self.interface_to_port(intf)['port']), "% ", 90) + (self.ipv6_to_tcl_format(ipv6), self.macToTclFormat(mac), self.chasId, self.pci_to_port(pci)['card'], self.pci_to_port(pci)['port']), "% ", 90) return out def ipv6_to_tcl_format(self, ipv6): @@ -424,14 +424,19 @@ class IxiaPacketGenerator(SSHConnection): return plist for p in self.ports: - plist.append({'type': 'ixia', 'intf': '%d.%d' % (p['card'], p['port'])}) + plist.append({'type': 'ixia', 'pci': 'IXIA:%d.%d' % (p['card'], p['port'])}) return plist - def interface_to_port(self, intf): + def pci_to_port(self, pci): """ - Convert IXIA interface to IXIA port. + Convert IXIA fake pci to IXIA port. """ - return {'card': int(intf.split('.')[0]), 'port': int(intf.split('.')[1])} + ixia_pci_regex = "IXIA:(\d).(\d)" + m = re.match(ixia_pci_regex, pci) + if m is None: + return {'card': -1, 'port': -1} + + return {'card': int(m.group(1)), 'port': int(m.group(2))} def loss(self, portList, ratePercent): """ @@ -539,19 +544,19 @@ class IxiaPacketGenerator(SSHConnection): rxPortlist.add(rxPort) # port init - self.config_port([self.interface_to_port( - self.tester.get_interface(port)) for port in txPortlist.union(rxPortlist)]) + self.config_port([self.pci_to_port( + self.tester.get_pci(port)) for port in txPortlist.union(rxPortlist)]) # stream/flow setting for (txPort, rxPort, pcapFile) in portList: - self.config_stream(pcapFile, self.interface_to_port(self.tester.get_interface(txPort)), rate_percent, 1, latency) + self.config_stream(pcapFile, self.pci_to_port(self.tester.get_pci(txPort)), rate_percent, 1, latency) # config stream before packetGroup if latency is not False: for (txPort, rxPort, pcapFile) in portList: flow_num = len(self.parse_pcap(pcapFile)) - self.config_pktGroup_rx(self.interface_to_port(self.tester.get_interface(rxPort))) - self.config_pktGroup_tx(self.interface_to_port(self.tester.get_interface(txPort))) + self.config_pktGroup_rx(self.pci_to_port(self.tester.get_pci(rxPort))) + self.config_pktGroup_tx(self.pci_to_port(self.tester.get_pci(txPort))) return rxPortlist, txPortlist def prepare_ixia_for_transmission(self, txPortlist, rxPortlist): @@ -559,12 +564,12 @@ class IxiaPacketGenerator(SSHConnection): Clear all statistics and implement configuration to IXIA hareware. """ self.add_tcl_cmd("ixClearStats portList") - self.set_ixia_port_list([self.interface_to_port(self.tester.get_interface(port)) for port in txPortlist]) + self.set_ixia_port_list([self.pci_to_port(self.tester.get_pci(port)) for port in txPortlist]) self.add_tcl_cmd("ixWriteConfigToHardware portList") for port in txPortlist: - self.start_pktGroup(self.interface_to_port(self.tester.get_interface(port))) + self.start_pktGroup(self.pci_to_port(self.tester.get_pci(port))) for port in rxPortlist: - self.start_pktGroup(self.interface_to_port(self.tester.get_interface(port))) + self.start_pktGroup(self.pci_to_port(self.tester.get_pci(port))) def get_transmission_results(self, rx_port_list, tx_port_list, delay=5): """ @@ -574,6 +579,7 @@ class IxiaPacketGenerator(SSHConnection): time.sleep(delay) bpsRate = 0 rate = 0 + oversize = 0 for port in rx_port_list: self.stat_get_rate_stat_all_stats(port) out = self.send_expect("stat cget -framesReceived", '%', 10) @@ -619,7 +625,7 @@ class IxiaPacketGenerator(SSHConnection): Get the connect relations between DUT and Ixia. """ for port in dutPorts: - info = self.tester.get_interface(self.tester.get_local_port(port)).split('.') + info = self.tester.get_pci(self.tester.get_local_port(port)).split('.') self.conRelation[port] = [int(info[0]), int(info[1]), repr(self.tester.dut.get_mac_address(port).replace(':', ' ').upper())] return self.conRelation @@ -656,7 +662,7 @@ class IxiaPacketGenerator(SSHConnection): Stop Packet Group operation on port and get current Packet Group statistics on port. """ - port = self.interface_to_port(self.tester.get_interface(port_number)) + port = self.pci_to_port(self.tester.get_pci(port_number)) self.send_expect("ixStopPortPacketGroups %d %d %d" % (self.chasId, port['card'], port['port']), "%", 100) self.send_expect("packetGroupStats get %d %d %d 0 16384" % (self.chasId, port['card'], port['port']), "%", 100) self.send_expect("packetGroupStats getGroup 0", "%", 100) @@ -674,7 +680,7 @@ class IxiaPacketGenerator(SSHConnection): """ Sends a IXIA TCL command to obtain all the stat values on a given port. """ - port = self.interface_to_port(self.tester.get_interface(port_number)) + port = self.pci_to_port(self.tester.get_pci(port_number)) command = 'stat get statAllStats {0} {1} {2}' command = command.format(self.chasId, port['card'], port['port']) self.send_expect(command, '% ', 10) @@ -683,7 +689,7 @@ class IxiaPacketGenerator(SSHConnection): """ Tells IXIA to prepare the internal buffers were the frames were captured. """ - port = self.interface_to_port(self.tester.get_interface(port_number)) + port = self.pci_to_port(self.tester.get_pci(port_number)) command = 'capture get {0} {1} {2}' command = command.format(self.chasId, port['card'], port['port']) self.send_expect(command, '% ', 30) @@ -692,7 +698,7 @@ class IxiaPacketGenerator(SSHConnection): """ All statistics of specified IXIA port. """ - port = self.interface_to_port(self.tester.get_interface(port_number)) + port = self.pci_to_port(self.tester.get_pci(port_number)) command = 'stat getRate statAllStats {0} {1} {2}' command = command.format(self.chasId, port['card'], port['port']) self.send_expect(command, '% ', 30) @@ -702,7 +708,7 @@ class IxiaPacketGenerator(SSHConnection): """ Tells IXIA to load the captured frames into the internal buffers. """ - port = self.interface_to_port(self.tester.get_interface(port_number)) + port = self.pci_to_port(self.tester.get_pci(port_number)) command = 'captureBuffer get {0} {1} {2} {3} {4}' command = command.format(self.chasId, port['card'], port['port'], first_frame, last_frame) -- 1.9.3