From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by dpdk.org (Postfix) with ESMTP id 42A711D90 for ; Tue, 12 Dec 2017 15:35:54 +0100 (CET) Received: by mail-lf0-f65.google.com with SMTP id f18so23426700lfg.8 for ; Tue, 12 Dec 2017 06:35:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RvzZCwhH8YJGXF2KnrU6Ptc+xKOsY2pqHa2EVX1h7+E=; b=aM3gNZ4NCy+v6Thpk1KeyUB4Tef4JhpW1yJxWEAzQS7B2fV/GLqLJLOW30YmNRxGy9 93Hsz/XTe6Bo8ynoLfVUMAsqm8fHX04vBG6rQf1+1xMW5Puh9Z51DPL19Abpn8S2yty1 E4i1t47jK4vj6et2vss9BNqKsL/4tFcG+i89g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RvzZCwhH8YJGXF2KnrU6Ptc+xKOsY2pqHa2EVX1h7+E=; b=koCvcH1+nKYAmPA1lbGYVPs/1iHAQrB4wnz9O+PSChsN30pyhazW/toshGoqfXWF8T QHw3PFL8jWh3DegLRA6tMRF067RM3uHPulobLxsE5qEFX+SRWcS9RunbzjHHMsk/UNVC +UV0OyuiEoZhih7QXeiQqMH9TJPCgaaB1fBl+CzJaQgR3o/01FXbj7Ig5frV+Fqmc1aJ I1Wcdz5rqF/V3hWeCT23OosMEKUuHggNai5yPIfvo2MdV+zKiFNmYAXpaIDgeiGIpWJP blUUHssSNc6eArY9qESZPS05d5WKMubrMDfFaRX+oLbxBSZIi50naHYbtuV/pggio68/ QkQw== X-Gm-Message-State: AKGB3mI6Scj611fEdJkU9Nzh8kHb51ASq8oiJjVc6QFhOnWk2q4cYlSF P4alklfxDqyJD7lTNWvE2WxTLxnJBog= X-Google-Smtp-Source: ACJfBotQiyHHWDlsWPQTB7GJISR0cxhxNQJA4dTWggHGuEyHG/iKWXnaEHyfCCD2YiMVxkNhjHQORA== X-Received: by 10.46.83.29 with SMTP id h29mr2189260ljb.144.1513089353756; Tue, 12 Dec 2017 06:35:53 -0800 (PST) Received: from rad-H81M-S1.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id g15sm3212933lfj.21.2017.12.12.06.35.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Dec 2017 06:35:53 -0800 (PST) From: Radoslaw Biernacki To: dts@dpdk.org, yong.liu@intel.com Cc: herbert.guan@arm.com, Radoslaw Biernacki Date: Tue, 12 Dec 2017 15:35:14 +0100 Message-Id: <1513089314-12719-2-git-send-email-radoslaw.biernacki@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513089314-12719-1-git-send-email-radoslaw.biernacki@linaro.org> References: <1513089314-12719-1-git-send-email-radoslaw.biernacki@linaro.org> Subject: [dts] [PATCH 2/2] framework/dut: Style and clean up 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: Tue, 12 Dec 2017 14:35:54 -0000 Fixing indentation Removing unused imports Signed-off-by: Radoslaw Biernacki --- framework/dut.py | 34 +++++++++++++++++----------------- framework/pmd_output.py | 2 +- tests/TestSuite_generic_filter.py | 1 - 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/framework/dut.py b/framework/dut.py index 6b89439..37590a1 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -260,25 +260,25 @@ class Dut(Crb): pci_id = port['type'] # get device driver driver, driver_module = settings.get_nic_driver_module(pci_id) - if driver is not None: - # unbind device driver - addr_array = pci_bus.split(':') - domain_id = addr_array[0] - bus_id = addr_array[1] - devfun_id = addr_array[2] + if driver is None: + self.logger.info("NOT FOUND DRIVER FOR PORT (%s|%s)!!!" % (pci_bus, pci_id)) + continue + # unbind device driver + addr_array = pci_bus.split(':') + domain_id = addr_array[0] + bus_id = addr_array[1] + devfun_id = addr_array[2] - port = GetNicObj(self, domain_id, bus_id, devfun_id) + port = GetNicObj(self, domain_id, bus_id, devfun_id) - self.send_expect('echo %s > /sys/bus/pci/devices/%s\:%s\:%s/driver/unbind' - % (pci_bus, domain_id, bus_id, devfun_id), '# ') - # bind to linux kernel driver - self.send_expect('modprobe %s' % driver_module, '# ') - self.send_expect('echo %s > /sys/bus/pci/drivers/%s/bind' - % (pci_bus, driver), '# ') - itf = port.get_interface_name() - self.send_expect("ifconfig %s up" % itf, "# ") - else: - self.logger.info("NOT FOUND DRIVER FOR PORT (%s|%s)!!!" % (pci_bus, pci_id)) + self.send_expect('echo %s > /sys/bus/pci/devices/%s\:%s\:%s/driver/unbind' + % (pci_bus, domain_id, bus_id, devfun_id), '# ') + # bind to linux kernel driver + self.send_expect('modprobe %s' % driver_module, '# ') + self.send_expect('echo %s > /sys/bus/pci/drivers/%s/bind' + % (pci_bus, driver), '# ') + itf = port.get_interface_name() + self.send_expect("ifconfig %s up" % itf, "# ") def setup_memory(self, hugepages=-1): """ diff --git a/framework/pmd_output.py b/framework/pmd_output.py index 2d1e3d7..da6b2d2 100644 --- a/framework/pmd_output.py +++ b/framework/pmd_output.py @@ -32,7 +32,7 @@ import os import re from time import sleep -from settings import TIMEOUT, PROTOCOL_PACKET_SIZE, get_nic_driver +from settings import TIMEOUT, PROTOCOL_PACKET_SIZE from utils import create_mask diff --git a/tests/TestSuite_generic_filter.py b/tests/TestSuite_generic_filter.py index e62e351..cc7744e 100644 --- a/tests/TestSuite_generic_filter.py +++ b/tests/TestSuite_generic_filter.py @@ -43,7 +43,6 @@ import re from test_case import TestCase from settings import HEADER_SIZE from pmd_output import PmdOutput -from settings import DRIVERS class TestGeneric_filter(TestCase): -- 2.7.4