From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by dpdk.org (Postfix) with ESMTP id C1EBE5AA6 for ; Thu, 22 Jan 2015 17:41:01 +0100 (CET) Received: by mail-pd0-f178.google.com with SMTP id y10so2583271pdj.9 for ; Thu, 22 Jan 2015 08:41:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XsfwJvMJfsxtTa75n3pysW8Wt5hAU0CYnE8IJMp5lQo=; b=OLha3xti9CCLbU94/shu6zGW+pmjs9z7Vx9Bs5ru2Ib0axCqAKlDGKpxN0jJDS5JgQ ox0Ofl71sju+RPDAyYHaf76bCUG5uOhXQetyd9DH2+ef1WCQNTyqS2/hyXWwL0wYfE6F 5OLLB9l4wF6eqHNNHQGIokKFQlKzBTudUuzPllPpjwbs4RHxiI8Qo+91V2siMU3Y9MjX b2axSPO/nVINulQ7B5QSCqwtIXY9O3xex3j+TIVPXZ4LnWdnlif4iM4pFcD85FCW9Hro LWuGnS2ysIHzFWF41If6lVOPEI2O15M8F3kuoFIIBRVVQqzbeBt/QHglv5oriEbVS+q0 11nw== X-Received: by 10.68.211.193 with SMTP id ne1mr3557768pbc.49.1421944861005; Thu, 22 Jan 2015 08:41:01 -0800 (PST) Received: from user-PC.hsd1.ca.comcast.net ([98.234.176.9]) by mx.google.com with ESMTPSA id bi11sm6584878pdb.8.2015.01.22.08.41.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Jan 2015 08:41:00 -0800 (PST) From: Ravi Kerur To: dts@dpdk.org Date: Thu, 22 Jan 2015 08:40:56 -0800 Message-Id: <1421944856-4590-2-git-send-email-rkerur@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421944856-4590-1-git-send-email-rkerur@gmail.com> References: <1421944856-4590-1-git-send-email-rkerur@gmail.com> Subject: [dts] [PATCH] Support for I217 and I218 Intel EC. 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, 22 Jan 2015 16:41:02 -0000 Changes include Added PCI-ID of I217V, I217LM, I218V and I218LM into appropriate files. Check driver is bound before binding, it reduces error messges in dts.log Check driver is inserted before removing, it reduces error messages in dts.log Add more delay after link up operation, since I217 and I218 takes more time than the tested NICs. Signed-off-by: Ravi Kerur --- framework/crb.py | 24 ++++++++++++++++++------ framework/dut.py | 5 ++++- framework/project_dpdk.py | 4 +++- framework/settings.py | 10 +++++++++- tests/TestSuite_ip_pipeline.py | 6 +++++- tests/TestSuite_pmd.py | 8 ++++++-- 6 files changed, 45 insertions(+), 12 deletions(-) diff --git a/framework/crb.py b/framework/crb.py index aca62c1..d41f51b 100644 --- a/framework/crb.py +++ b/framework/crb.py @@ -142,7 +142,9 @@ class Crb(object): self.send_expect("rmmod vfio_pci", "# ", 10) self.send_expect("rmmod vfio", "# ", 10) else: - self.send_expect("rmmod igb_uio", "# ", 10) + out = self.send_expect("lsmod | grep igb_uio", "#") + if "igb_uio" in out: + self.send_expect("rmmod -f igb_uio", "# ", 10) self.send_expect("modprobe igb", "# ", 20) self.send_expect("modprobe ixgbe", "# ", 20) self.send_expect("modprobe e1000e", "# ", 20) @@ -151,14 +153,24 @@ class Crb(object): try: for (pci_bus, pci_id) in self.pci_devices_info: + """ + Check if driver is already bound before binding it. + """ if pci_id in ('8086:10fb', '8086:151c', '8086:1528', '8086:1512', '8086:154a'): - self.send_expect("echo 0000:%s > /sys/bus/pci/drivers/ixgbe/bind" % pci_bus, "# ") + if not os.path.exists("/sys/bus/pci/drivers/ixgbe/"+"0000:"+pci_bus): + self.send_expect("echo -n 0000:%s > /sys/bus/pci/drivers/ixgbe/bind" % pci_bus, "# ") elif pci_id in ('8086:10e8', '8086:150e', '8086:1521', '8086:10c9', '8086:1526', '8086:1533'): - self.send_expect("echo 0000:%s > /sys/bus/pci/drivers/igb/bind" % pci_bus, "# ") + if not os.path.exists("/sys/bus/pci/drivers/igb/"+"0000:"+pci_bus): + self.send_expect("echo -n 0000:%s > /sys/bus/pci/drivers/igb/bind" % pci_bus, "# ") elif pci_id in('8086:10d3', '8086:10b9'): - self.send_expect("echo 0000:%s > /sys/bus/pci/drivers/e1000e/bind" % pci_bus, "# ") + if not os.path.exists("/sys/bus/pci/drivers/e1000e/"+"0000:"+pci_bus): + self.send_expect("echo -n 0000:%s > /sys/bus/pci/drivers/e1000e/bind" % pci_bus, "# ") + elif pci_id in ('8086:153a', '8086:153b', '8086:155a', '8086:1559'): + if not os.path.exists("/sys/bus/pci/drivers/e1000e/"+"0000:"+pci_bus): + self.send_expect("echo -n 0000:%s > /sys/bus/pci/drivers/e1000e/bind" % pci_bus, "# ") elif pci_id in ('8086:100f', '8086:100e'): - self.send_expect("echo 0000:%s > /sys/bus/pci/drivers/e1000/bind" % pci_bus, "# ") + if not os.path.exists("/sys/bus/pci/drivers/e1000/"+"0000:"+pci_bus): + self.send_expect("echo -n 0000:%s > /sys/bus/pci/drivers/e1000/bind" % pci_bus, "# ") elif pci_id in ('1af4:1000'): self.send_expect("echo 0000%s > /sys/bus/pci/drivers/virtio-pci/bind" % pci_bus, "# ") else: @@ -226,7 +238,7 @@ class Crb(object): """ Get interface name of specified pci device on linux. """ - command = 'ls /sys/bus/pci/devices/0000:%s:%s/net' % (bus_id, devfun_id) + command = 'ls --color=never /sys/bus/pci/devices/0000:%s:%s/net' % (bus_id, devfun_id) return self.send_expect(command, '# ') def get_interface_name_freebsd(self, bus_id, devfun_id): diff --git a/framework/dut.py b/framework/dut.py index 4def144..f901270 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -420,7 +420,10 @@ class Dut(Crb): out = self.send_expect("ip link show %s" % intf, "# ") if "DOWN" in out: self.send_expect("ip link set %s up" % intf, "# ") - time.sleep(5) + """ + I217 and I218 requires more time to acquire V6 address. + """ + time.sleep(25) self.logger.info("DUT: [000:%s %s] %s" % (pci_bus, pci_id, diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index 6e25f1f..3577eb7 100644 --- a/framework/project_dpdk.py +++ b/framework/project_dpdk.py @@ -96,7 +96,9 @@ class DPDKdut(Dut): assert ("vfio_iommu_type1" in out), "Failed to setup vfio-pci" else: self.send_expect("modprobe uio", "#", 70) - self.send_expect("rmmod -f igb_uio", "#", 70) + out = self.send_expect("lsmod | grep igb_uio", "#") + if "igb_uio" in out: + self.send_expect("rmmod -f igb_uio", "#", 70) self.send_expect("insmod ./" + target + "/kmod/igb_uio.ko", "#", 60) out = self.send_expect("lsmod | grep igb_uio", "#") assert ("igb_uio" in out), "Failed to insmod igb_uio" diff --git a/framework/settings.py b/framework/settings.py index 0d4ed82..2ef8db8 100644 --- a/framework/settings.py +++ b/framework/settings.py @@ -50,7 +50,11 @@ NICS = { 'springfountain': '8086:154a', 'virtio': '1af4:1000', 'avoton': '8086:1f41', - 'avoton2c5': '8086:1f45' + 'avoton2c5': '8086:1f45', + 'I217V': '8086:153b', + 'I217LM': '8086:153a', + 'I218V': '8086:1559', + 'I218LM': '8086:155a', } DRIVERS = { @@ -72,6 +76,10 @@ DRIVERS = { 'virtio': 'igb', 'avoton': 'igb', 'avoton2c5': 'igb', + 'I217V': 'igb', + 'I217LM': 'igb', + 'I218V': 'igb', + 'I218LM': 'igb', } """ diff --git a/tests/TestSuite_ip_pipeline.py b/tests/TestSuite_ip_pipeline.py index 9c56799..7da393e 100644 --- a/tests/TestSuite_ip_pipeline.py +++ b/tests/TestSuite_ip_pipeline.py @@ -292,7 +292,11 @@ class TestIPPipeline(TestCase): """ # Check for port availability - self.needed_ports = {"niantic": 2} + self.needed_ports = {"niantic": 2, + "I217V": 1, + "I217LM": 1, + "I218V": 1, + "I218LM": 1} self.dut_ports = self.dut.get_ports(self.nic) self.verify(len(self.dut_ports) >= self.needed_ports[self.nic], "Insufficient ports for speed testing") diff --git a/tests/TestSuite_pmd.py b/tests/TestSuite_pmd.py index acd6364..b88352f 100644 --- a/tests/TestSuite_pmd.py +++ b/tests/TestSuite_pmd.py @@ -96,11 +96,15 @@ class TestPmd(TestCase): "kawela_2": 2, "bartonhills": 4, "82545EM": 2, - "82540EM": 2} + "82540EM": 2, + "I217V": 1, + "I217LM": 1, + "I218V": 1, + "I218LM": 1} self.blacklist = "" - self.verify(self.nic in ["kawela_2", "niantic", "bartonhills", "82545EM", "82540EM"], + self.verify(self.nic in ["kawela_2", "niantic", "bartonhills", "82545EM", "82540EM", "I217V", "I217LM", "I218V", "I218LM"], "NIC Unsupported: " + str(self.nic)) # Based on h/w type, choose how many ports to use -- 1.9.1