From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0080.outbound.protection.outlook.com [104.47.38.80]) by dpdk.org (Postfix) with ESMTP id 382105A98 for ; Wed, 19 Apr 2017 14:22:48 +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=35rrGe5tqZwwgPgcrvmfTrSWcHw/WoC/tuueBL+yLoo=; b=TYoSQSb5Iw08lKtpaofDEjsE8awIVdWuB3ah8d9dR2lcK8rqaF34R9PV1noe617+mOw9eLTH20M0pjyCi6daB7V0g2V/NOCr6uY6VRRVGeq56fGkVzSOaZdBm5fg12tRaR0HjELSlxBPlPxJtz7Q4NbbfWsJeqZg9UtBeU91uY0= 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 CO2PR0701MB805.namprd07.prod.outlook.com (10.141.246.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.10; Wed, 19 Apr 2017 12:22:46 +0000 From: Angela Czubak To: dts@dpdk.org Cc: Angela Czubak Date: Wed, 19 Apr 2017 14:21:59 +0200 Message-Id: <1492604540-12114-7-git-send-email-aczubak@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1492604540-12114-1-git-send-email-aczubak@caviumnetworks.com> References: <1491501092-14278-1-git-send-email-aczubak@caviumnetworks.com> <1492604540-12114-1-git-send-email-aczubak@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: AM5PR0701CA0064.eurprd07.prod.outlook.com (10.169.145.154) To CO2PR0701MB805.namprd07.prod.outlook.com (10.141.246.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2a3adf8c-c5bc-45cc-2afc-08d4871ec9e5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CO2PR0701MB805; X-Microsoft-Exchange-Diagnostics: 1; CO2PR0701MB805; 3:DodqkHk22Wa3Kb2ZTcZEY+2uKbJhbAnivj2K0WUeE0EaGbiS/6I5+qnRVYQ6ZkC9FqFfV61wK29scwTGZpyfzrIaPVrxX/KT/I9m1GOr85Jpr7UYSQWJuc3NCg7WHh6a1U03CbZeC/aYV6X2SAULQRSNx0eAoj9jhwjTQFLd+XJXllfzgEdRXQnjzsF2QvEBgNswdnQ+WWyh10qn9O/2smgz4ck7nb2uiftMUJ2wS3YYPrp7mDrUfp+SGXowYk0GBS7YHH9rZxj3f9zA3WKPaT1lUWI1GNV0UglKF0xLRGx6zZnd1Z2Ut5RKEan209H5fpb9EB1ZSSzB6N/F96saNg==; 25:Vf+ftBwZ3Pwb2yu44tC/XsDtjjV/+z8CowYoV6q8We1wnVnXeXn3d/hwwEofDUAwfZ6cRGW8IgHwb0qBTe4Ib6dZtL1/UeIo7hfyl39iWMloDP5KBCJKmzbZYKsXt3sN7hFaQ8x5GJlEIEKl7nMG8p+bulb9CXb3xaESXhHjqenr/rVdAGG41ch16yYl+ZCO7hpoama0hOHiEOO9hLAlBxH/GJ8yGRfqnyvE2VAWCRY9hkS1Ve0XbhnZFhELwG6CZYx5MmEZlT8/TofTtNkJ/7x381wQvYyG+/W69zMa0o6843CCdhojX5B9Db3ZtLqJq7tsRc2AAhQCqgA/PYRgxB3B7dLw5iIb2NudX4wJjlWKZ0XFiOtjRAPk5MDQYA/EBimkESoqum3lmr9CbrDfQkRFu1xpxH4741Nd97coNUOtbaey55w1gfrNcnGhT1BA9DQ7wC/96hV/Nm40ECLHRg== X-Microsoft-Exchange-Diagnostics: 1; CO2PR0701MB805; 31:aJWiYv4aTbOhkF1V4SRgtiV3eabD54UJW4+UpROPsYKFjD2uMXgGMb5hyKaIyA/PmFlrgd1RJtDgpBUEld3u9DRnxCq+CCSe8QiZ6IUM0lRvKPhWOLiIpJQtEu0+N3RQoYuu1iFoYAId5A9HuaRcW9kzZn/SiNMFl7rQvBCqT2pDZHFCYn/j1h3A1h3pTX4LXazVx0fkGHbuTRr/JdEv9bfAr45V/l89LmMVqGUywOE=; 20:jvn/NectVpWXzUn+2gb/97u/0oQAOVBpXHrSL9qNYuaQE0WZP8HEIioplojI75BSvvPYslZZcDJL5GIXwkzDkPX4qM6txzl1HhpDE993zZw2Uc1OycU9C679KL18G4hwzzaAm4Z8bk2iAD2FHdBr0gY4UZQIepkm9qL1brYjaV3hrBCTWhmZ0Z8cinh+qNX7Sp20eYcoQ3RpuYDI0mMPqGh5GAGHP1z4DwTIWZA+r9xdwvsVzETcL0R+9HXTULgH/oUe5NTuoOJnr8Q1aRWtbcIeQkDwz0hW9FS9wwRfPkkMPxMXYpuEyzlNiEhctR2EwVfpotH3hlXJP+zWO7GXCu3W36vgkZylvD8k91BTpsSaTB+O0dO93yHTyZxH/AbF9We5Y7fqn6eIm0DTRFivhUr+zrhCbiTBu1IQ0XM5APdKvnpzY0wHzahYIBRnW+6QggU195T+5gKUCrNYmXQBro6rF3uk33Aq8pi0jIzLxVRhEZcGl9zAjuohNnt6cPr9B2lBY61UODt6OxeP8Cr4/gHB99FR/55WjGdVCil9vO+mhvJBCvfdFkQZ9LSysxY3kLHiMDFuSDPps4FIujsaxc+vcu6sqyDTvpAYaYdjNdo= 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)(3002001)(10201501046)(93006095)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:CO2PR0701MB805; BCL:0; PCL:0; RULEID:; SRVR:CO2PR0701MB805; X-Microsoft-Exchange-Diagnostics: 1; CO2PR0701MB805; 4:puJlOA88TFmrPlzp5uEJeNHL+nxLYVTSAYGE5EBl0d9IORo0+rc7GgnmXwdfgW8C11R6gnie5q1Fsf67KFW0QrnqjLjOoFTrTSFdulLkyW0O9uNVeiq0dH0Wgeg2oPpP1wRJ6dcEKgHszG6IkpYKer6sccqaVMU7+Op7EaIzSOBKmlZ0X9any8O8hQFZee36Fyp61KicRw4yM+AW5O79wl8Hrv6FqcHWuGjWVtNWEYz2zLjbelM90kog//2pe89nocOEPOfFJfEW2+kZo7y1QmUvOIQU9AfQU1JnD87f+ewzBB2DKkkbTOTYqTdUuaF4Na5tz/HufF92h7yMrngOtkaId4mMWoGlihw93fCoSBTM3phwOW/54HeqXkAA1feoCRgPOq9kbjqDTycCg1xT0kyeIt9boLlFHWcWXhzazUNFiOYPIs9NSyHSkmfwGsmjazuRIrZ2Wnd4RGOZ1ibkQBR3nWvVMl8k+SRdWi4eZmm1AvwZbgauV6aNmcABT0kifK4ond4kGaWGronhZ3w5yElWoFOZz/QzbzVjcJKvPqT6wmzMaVJqdIOod07Gz+9XOKH2khJk4wRME0kXZiFg2tZm2DLSSA8smVx90o7DwZdlebP+9XEZs8oQgReEgwkRhnuR+jWtrW4p8m/wzRkoNgIP5JidlS9KC6M6v/TMxbj33ocF3ibxUgP8IgPUzziu/KKfyxuwWz3uJQH1abC44xnr95ZTBrjJgNSc7uQegh/nsjGvptqkZtFO8FFKika8FijaO5RCH8BoVeDIwM+MvA== X-Forefront-PRVS: 028256169F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39850400002)(39400400002)(39840400002)(39450400003)(6486002)(5660300001)(38730400002)(6506006)(7736002)(6512007)(66066001)(305945005)(47776003)(53936002)(42882006)(110136004)(6916009)(2906002)(8676002)(4326008)(2950100002)(50226002)(81166006)(25786009)(107886003)(6666003)(36756003)(5003940100001)(42186005)(33646002)(3846002)(6116002)(2351001)(2361001)(189998001)(76176999)(50986999)(48376002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR0701MB805; H:angela-H81M-S1.semihalf.local; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR0701MB805; 23:8ju5YwA5Zwe1HmmYAnVeeXL8S0UzmDmJa1BAYLXo?= =?us-ascii?Q?llk/n9ZtZ99MBw7a8RX1+M16BogAKyVzIvmuh79fGDc9rn5RpHw3tqGYndc9?= =?us-ascii?Q?VGjJ1wswjf5AHfLQTh82vABqOAGJqEXTqMNKO5bOPa1AEBnzt50Oy0B/OVwQ?= =?us-ascii?Q?YORF1RnelFr68038PcykKsW8/FRsCYUfRge5mSAuyDPpd1YiVU3jQzE/7kgn?= =?us-ascii?Q?wdmw7lRAOVrl082lqcBeN25d0KDBMX9WrCBPavu6KwOo7priksaDFESLj5w2?= =?us-ascii?Q?Z2RmKJEX5LoyjTbHuDzRyu58sYJj67iLYK97C41gjreA+SuddyaKRzI+NmlG?= =?us-ascii?Q?utOb7JJluYF8i6HXcrmNWeacP89T+nZNPtcrHr0MokIOKNSCqe3bQIWsiKbA?= =?us-ascii?Q?N+Nly2pBS97fdXjOUlUYivnNMDikrgQATsGoe3firg9H780GShPUKTv0t/ST?= =?us-ascii?Q?iwyi6ICpM5fNO+5uUKs3OgLdA4RrOPYnCV3+uFiArnXAHGw4SL8xbzZ7fR+g?= =?us-ascii?Q?3LT6fOyfxj7JPHTZ+E28WRrAGkOGaZCHzgbBx+D6f4D/BkFhBg2qxZy8NCr5?= =?us-ascii?Q?qjfu9WXA0j8RPDwrwsfCOwSuPN+5RAF8Y/uglx0Owg7nUtbOakPy0y3JyGFR?= =?us-ascii?Q?DdyqXMmDr7m/kzEh5W4jcMNHxobABFQ2kzEZK7kISqn+F3NhlxXcGUrr4tpu?= =?us-ascii?Q?Lh6hYfsxWVbcH8Wn3OSzNLCJcCW2M+gb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1w9Zgx+BCA==; 24:uYY7pMVlegNEzkcBgAeOerLzuLMynalj+tp1DgmbwqFt92CcXMbaaPEbN19sObnafJrFhF6844HzOosmbcPoJuBJ58Bw/5SZA7jwyJN1YkA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR0701MB805; 7:J0/FDXiHp3OXYV8F6Ho0javnzbrK31vrUR662AlS2lhQj1Dc+MVlTQ/vgLI1z0RgRNElpWw6zHmGbcnb/qP6LF4uiSXd488k+000B9yh8bH+chN/sZBXWKh8ZTYwbi8scBcrU06J03fWZ0CEvIxTQiAXVLP4hG3miAb8gMv4IjWH/2aSdeva2cd1mSHLV9QVaxQ7omuOwlKkxk4hF0dBCTEtK6c3ZpRr554GwOaQw/UAfQGNpHQDMlw3KcK6UECciwBI9GgZGHP0MqHI+3UWptV092gi6h7LnYXY/O8Ar7pBoTfgoCoypcjF6S/B2HYA00QJQ+iFkpcvzKsmGmhDdg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2017 12:22:46.4834 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR0701MB805 Subject: [dts] [PATCH v3 06/27] 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: Wed, 19 Apr 2017 12:22:48 -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 | 28 +++++++++++++++++++--------- framework/tester.py | 11 +++++++++++ nics/net_device.py | 8 ++++---- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/framework/dut.py b/framework/dut.py index 4a2afa2..3e90670 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -600,7 +600,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') @@ -920,15 +925,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/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