From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0041.outbound.protection.outlook.com [104.47.34.41]) by dpdk.org (Postfix) with ESMTP id 73A2C3798 for ; Thu, 6 Apr 2017 19:51:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=uW+DIXv1H1OUmjEnSpbOxeguq/SEakW5wvLkMtue+us=; b=kGV9ATZQpBdEXSzr2s521NeuVL6/Gh5hGNLiG8AWSVKdhPO0kmoHfx6t/dPEHNsjlw9up5iRyXwIVdwi8r+4QbECaQzdmnLufulx4a15nzG5ZpL9wkBfF1UwwKyKqNcTYD7OVlR2HRyJZCPMwSx+VYbivCe1nhke469qCR+OFxs= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from angela-H81M-S1.semihalf.local (31.172.191.173) by DM2PR0701MB810.namprd07.prod.outlook.com (10.242.127.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Thu, 6 Apr 2017 17:51:51 +0000 From: Angela Czubak To: dts@dpdk.org Cc: Angela Czubak Date: Thu, 6 Apr 2017 19:51:12 +0200 Message-Id: <1491501092-14278-7-git-send-email-aczubak@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491501092-14278-1-git-send-email-aczubak@caviumnetworks.com> References: <1491501092-14278-1-git-send-email-aczubak@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: AM5PR0701CA0051.eurprd07.prod.outlook.com (10.169.145.141) To DM2PR0701MB810.namprd07.prod.outlook.com (10.242.127.24) X-MS-Office365-Filtering-Correlation-Id: 24325e94-6741-487b-4941-08d47d159b28 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:DM2PR0701MB810; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB810; 3:XehtBJZE7cnO2uGi/z4DJRispOtRowsOY3mPl9tAZ76SHic4AsodtY8b3wTp8BNhyw9OtLCxYiW/JQg0BC881bEZ38nirx+4MNPiN1V+8eQv10Te2rQcGuxxXJUM1E0QE7rLWQTfAB71RfiRxkSJ/4ldCWvBa4P3dgCO7HGKbyrfEXtTBmxQ1hh04EBOJTjif2gVY0Y9v/oUl8pa0oelus669BVX44hJ02oSsaNIR6I+lXLI8TCxcIfY7qwu/SzduOxctEkXF3IAPLGdexvS/B0RTowd+n5bO5m0HGpshI5kU+wZCxYdnCIQ+QsracOmXOyFK2kYE8G1GMPQgABzeA==; 25:CmRbCAvg1r0GjM9Adm4yfE5520U5+ijXcxTP0NR601zNXvKDi1hIzRIkfk5R3kbylP4V8cKGg18hBTFYJLrMP7R+BOEahoXD+rIs6u8EDTjl5ei11x4NdDoJ9capz/H8K/nUoBB2xPIwqM0OiVlBz7UlIS0rL6k03H4iBH90VSfDH+7yZqm5tDbD6PilLbiu4UivfneDB4aHnbEF14biNfG8CjY32PeKwcHHxlRfYKWwMUXi9/w81cGFl3/prlUgIQhKOESXgNa9Z+h9YMyPLjajolV33qoR5Zgec1pKZ2kk2w9ng4YakNFHmvsuJol+yfLP6EXINCnwGCaZPJchsdUSX0vwksvgRpXfWzZQUYzqQQxvEbycGevIUk1TBw2OSRSZ2ENZX97YPD+fkXg9xNYSknHlwkJoSQ6Ur6NlSPHC7RsZIVj8qakwto+NW7qSt0xj/MJamUHijW/oa2fOlA== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB810; 31:wCTCDD5ASKEWDKHL0j2S/1U7z9EXZCMROtRU9QaGmAkuMYYMonqAcQ1Un41H1lLl6eNPZLF6luaWfRAnExhOHqAUbxkziLvpkPXPs5MjDEapBOf3ySsf0CrgI417UWEhXVd/9rh65Sbsc/HgGcWt9w4rRqxR69npxG4qRhrcnqli+hq6pEMOvtZSBxleZHqfeOanWn1U6cXsiv7SLXCzJsb8NxZdiHtXNBFc+DX987so+UJRISZRPQb41VoYYWQKT/xXEKkO3QFFJwbGC0OfaA==; 20:NUd4nZKZkfd5BYv9yFKD6UiDeU7VuU4JrQzid8d8Eer9kA8Jx53SbjlG2yCFbZQgGKH5PCYeiry8sqVPNHlsFDjTkqWs7d2I80FqUmRObe+tI5BfFxg0v7MgxZ5QBJRRBkU4pfcV3pxmUXqjjGdof18K8ig1DdxlaKikRt4tPJfzKzcvbuNb4IS0jf2+YlqTsqDdAGwmQqEytY2fMuHUKs2WLLW1PG1xJgFxZUzKxQCL2MqQJhevJ2I8dl7hxj4es4F8P/qvQsWaoroCyq2eRnG/3LOrFiVGqjvmWTs6LQnOnI9PYbWn5TKJ5Vn9MOo8viPDnYIPIMONsGXuWR0LMMjy3QTOWSgxhceoqN7Vn/oM196xyTItRz9A64QJtDDbz48KTIQZulddErP3lhPI2ID4Fqs/ycidVUji25pl5RAWHz7eJiFhA9A6itMYJcrZ6E32/9qoZRdfBtE68ZMiCz0crQ53Ca2QsRrNbpRW/xtQpw+R8ZbEOZRHo16X+ZRWId75kRSGzSddrfABx3K9CxLurArwWT2E17qXIBtKKkhPS/tUj+Yk8BsX6s6CXzi4IXJnDlKD/LQA5MXHpPiIxUm9/6jmMC2pG+LrTaAXOkg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(127540120423786)(21532816269658); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(6072148); SRVR:DM2PR0701MB810; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0701MB810; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB810; 4:16MYWqR6ZpJA3kNC52fOKX15su6gkzJPgzi/rSEgPVE6L0mm9iUn0I6O1K4/AFqvOAwr8eLENI1JlCMc8MKZySBZvjE9KkinLV7PTDhegZ632guwxjW1QAWp2m/8/n1TUWsoANzty0X14TrgQf9iSrMzWbjrV/vBg/efrUMLgr5AzXpBESFgitarMiuISdd1XbrC3+tM2RvX1uaSNRui+U8WCOih2ViRcd08HBGDtDu2IVRC8gSnNmrVGwU+J+hQlCXsWRocW93+I9cgH+hdiV30gvxD7anioRgGzrtYxmg2gEiGA6I01nd066Xw/GemM18D8KP8PUcb67tpp12VdiNrOvzDN2fg5BRcSxOL4BwTo1qd1vHtbi1+8pDCTewW3w2M+Z72uAAnARg6Sm6vlqrsqYju5p1u2jDhmX7E0GaEPl02qicJPuC1iCB/uJazHI3sXorjsg+KeAArKA68Mu/Yaw8dUEj2jveW5Gj0iReHTWGU+gxoKlqlP6bBt2osGRbHyvV9nGKvGihgYSEHnbL327x1Eh1Jj3lD0XwPOwYiGyhxGVW1T4O1jO+YDwvfJVo8WLxs6KnYkv4UJSdBcsd0r6KBSVVl4d79Geqg5oO3OLe0w7yZG4TEp4VmQWlGgLtnWwmfyvTRAGL3GJBpCKsFL0jTD2/49J+6FH/zxyjM2TqYD8yuLRHICJl41StqnL8dYGTESHp7TKEI5x4WNdqkQzwEWPIdu8BZfvqa4IP+GsP+FXAgbUJACyh4WL4itUaGwUqfTiZjcemsDnNTkQ== X-Forefront-PRVS: 02698DF457 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39830400002)(39450400003)(39400400002)(39410400002)(3846002)(50226002)(6116002)(47776003)(33646002)(6506006)(189998001)(6486002)(48376002)(50466002)(36756003)(66066001)(8676002)(5003940100001)(2361001)(42882006)(110136004)(107886003)(38730400002)(76176999)(25786009)(2351001)(6666003)(81166006)(42186005)(50986999)(6916009)(6512007)(7736002)(53936002)(4326008)(5660300001)(305945005)(2950100002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0701MB810; H:angela-H81M-S1.semihalf.local; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0701MB810; 23:neraBWDkDuSJnh7C11pE6k9lU4CXHNTjFOr0NakS?= =?us-ascii?Q?pp+0Z4fMVZuxPZToy3L5oHIOPU07EwgMEf1lyK5YceXzXQ8DCxDAJJg09uV3?= =?us-ascii?Q?MGhN/6ENxPKj8o+4Jj1jo31VamoG5+HKRXkZrZtFerfeDz5y28+sPE7EzBMA?= =?us-ascii?Q?nY2oycC4pKWTk7VwwNaU+wrPRdsIP1bS85VRYLQKwaDcSfM4sg2dh739Zqi/?= =?us-ascii?Q?qR/vaHpsmIJXHAAM79IVtzNXkbbKtD6qBxHuLpof4XdabJ2KXVt30gZKit1g?= =?us-ascii?Q?80oAiJEX9cirX+V90GseqN9Z574eQT4OcL3xVXkOy7DrGA1PEWDfaQ4VxQ5P?= =?us-ascii?Q?AbL/M1A3pONVBpQAuFxAhRxJcRq7qviJ/sRipwJS1A/O4Md5eFuK5RM8ZteY?= =?us-ascii?Q?IpFhTmeEBIZwwmR6idBUMGlWGALfIZnVpjImT8oo+z2jjpyG0+xnR6BfrRmv?= =?us-ascii?Q?yzkphkY9otPBr1+LgLZsJRbgQzJkjFRr66u99/Pf16I0x2iw5hEywRixdyzU?= =?us-ascii?Q?IatikYo1hwe3R8QUyORXcTIo0Ef+AP8YazSmOvyxG11LGNeOJW3VowzkDr65?= =?us-ascii?Q?Gxa9XG9mxQx4ND5ruXlvy0sy+mP2g81fLxboy2E436+WKjZDTDfosJ60MOmg?= =?us-ascii?Q?xM51zhmxtxJ1ktY75Cx/uuR0UZqktGACmtwYl7EZBOd0SGnXmFrGnzFmGPaJ?= =?us-ascii?Q?NQRCLLMLRgDqJKNATNgNK6DwRVAKqJnoGjPep5PCZWeOFYeCAxPHr/kWpNhf?= =?us-ascii?Q?nDEk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put: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB810; 7:OQSYLSTZT6a5PiEzKLHEOMtKVB8F+zRXNoX/S5j76/TNndJ8OWSmDX8PvaqqNDcCBAnXF935Ly6h+v4M8L1PPjvMdF4teWzE5lrGs2H5i8auXx57ZWgPeGrBon9Jm98HoOyHU6oL5eLZkxBquf1WT1Pur1WFDutsXkce+nE8XcTvdalfXWY5B4ygksg5pkzEMKsp3mubu18Eb8om8dYSov8ZhY4JUXznWer5765tTujluw/VHCAFLaICS7qosywOXXt8InZQSMgm40i/ymhs9OfXPMDZTS3/ep5W31vmkJ48Y+Af0ExekKCaN/muxGxWfsTqMWJQIG6BiGef6GPwUw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2017 17:51:51.1171 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0701MB810 Subject: [dts] [PATCH 06/26] framework: checking link with IPv4 ping 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: Thu, 06 Apr 2017 17:51:54 -0000 Some kernels may not use IPv6 and hence there is no point using ping6. If lack of link by IPv6 is detected then IPv4 pings are sent (previously ports where skipped if they had no IPv6 connectivity). DPDK binding script uses "--force" argument, since interfaces are detected as active. Signed-off-by: Angela Czubak --- framework/dut.py | 30 ++++++++++++++++++++---------- framework/project_dpdk.py | 2 +- framework/tester.py | 11 +++++++++++ nics/net_device.py | 8 ++++---- 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/framework/dut.py b/framework/dut.py index b5a21ce..cd899c8 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -382,7 +382,7 @@ class Dut(Crb): return op = self.send_command("ls") if "usertools" in op: - self.send_expect('usertools/dpdk-devbind.py %s' % binding_list, '# ') + self.send_expect('usertools/dpdk-devbind.py --force %s' % binding_list, '# ') else: op = self.send_command("ls tools") if "dpdk_nic_bind.py" in op: @@ -602,7 +602,12 @@ class Dut(Crb): if ":" not in ipv6: ipv6 = "Not connected" + out = self.send_expect("ip -family inet address show dev %s | awk '/inet/ { print $2 }'" + % intf, "# ") + ipv4 = out.split('/')[0] + port_info['ipv6'] = ipv6 + port_info['ipv4'] = ipv4 def rescan_ports_uncached_freebsd(self): unknow_interface = RED('Skipped: unknow_interface') @@ -922,15 +927,20 @@ class Dut(Crb): # skip ping those not connected port ipv6 = self.get_ipv6_address(dutPort) if ipv6 == "Not connected": - continue - - if getattr(self, 'send_ping6', None): - out = self.send_ping6( - dutPort, self.tester.ports_info[remotePort]['ipv6'], - self.get_mac_address(dutPort)) - else: - out = self.tester.send_ping6( - remotePort, ipv6, self.get_mac_address(dutPort)) + if self.tester.ports_info[remotePort].has_key('ipv4'): + out = self.tester.send_ping( + dutPort, self.tester.ports_info[remotePort]['ipv4'], + self.get_mac_address(dutPort)) + else: + continue + else: + if getattr(self, 'send_ping6', None): + out = self.send_ping6( + dutPort, self.tester.ports_info[remotePort]['ipv6'], + self.get_mac_address(dutPort)) + else: + out = self.tester.send_ping6( + remotePort, ipv6, self.get_mac_address(dutPort)) if ('64 bytes from' in out): self.logger.info("PORT MAP: [dut %d: tester %d]" % (dutPort, remotePort)) diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index f3d3701..2a50e87 100644 --- a/framework/project_dpdk.py +++ b/framework/project_dpdk.py @@ -325,7 +325,7 @@ class DPDKdut(Dut): op = self.send_command("ls") if "usertools" in op: - self.send_expect('usertools/dpdk-devbind.py %s' % binding_list, '# ') + self.send_expect('usertools/dpdk-devbind.py --force %s' % binding_list, '# ') else: op = self.send_command("ls tools") if "dpdk_nic_bind.py" in op: diff --git a/framework/tester.py b/framework/tester.py index d793e91..5cf5e00 100644 --- a/framework/tester.py +++ b/framework/tester.py @@ -336,6 +336,7 @@ class Tester(Crb): macaddr = port.get_mac_addr() ipv6 = port.get_ipv6_addr() + ipv4 = port.get_ipv4_addr() # store the port info to port mapping self.ports_info.append({'port': port, @@ -343,6 +344,7 @@ class Tester(Crb): 'type': pci_id, 'intf': intf, 'mac': macaddr, + 'ipv4': ipv4, 'ipv6': ipv6}) # return if port is not connect x3 @@ -364,6 +366,15 @@ class Tester(Crb): 'mac': macaddr, 'ipv6': ipv6}) + def send_ping(self, localPort, ipv4, mac): + """ + Send ping6 packet from local port with destination ipv4 address. + """ + if self.ports_info[localPort]['type'] == 'ixia': + return "Not implemented yet" + else: + return self.send_expect("ping -w 5 -c 5 -A -I %s %s" % (self.ports_info[localPort]['intf'], ipv4), "# ", 10) + def send_ping6(self, localPort, ipv6, mac): """ Send ping6 packet from local port with destination ipv6 address. diff --git a/nics/net_device.py b/nics/net_device.py index 0af4ad5..4861145 100644 --- a/nics/net_device.py +++ b/nics/net_device.py @@ -343,21 +343,21 @@ class NetDevice(object): """ get_ipv4_addr = getattr( self, 'get_ipv4_addr_%s' % self.__get_os_type()) - return get_ipv4_addr(self.intf_name, self.currenct_driver) + return get_ipv4_addr(self.intf_name, self.current_driver) def get_ipv4_addr_linux(self, intf, driver): """ Get ipv4 address of specified pci device on linux. """ try: - get_ipv4_addr_linux = getattr(self, 'get_ipv4_linux_%s' % driver) + get_ipv4_addr_linux = getattr(self, 'get_ipv4_addr_linux_%s' % driver) except Exception as e: generic_driver = 'generic' get_ipv4_addr_linux = getattr( - self, 'get_ipv4_linux_%s' % + self, 'get_ipv4_addr_linux_%s' % generic_driver) - return get_ipv4_addr_linux(intf, domain_id, bus_id, devfun_id, driver) + return get_ipv4_addr_linux(intf) def get_ipv4_addr_linux_generic(self, intf): """ -- 2.7.4