From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 9574D5957 for ; Fri, 7 Aug 2015 07:36:24 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 06 Aug 2015 22:36:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,627,1432623600"; d="scan'208";a="779484104" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 06 Aug 2015 22:36:23 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t775aLdT004641; Fri, 7 Aug 2015 13:36:21 +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 t775aJ9t032698; Fri, 7 Aug 2015 13:36:21 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t775aJc7032694; Fri, 7 Aug 2015 13:36:19 +0800 From: Yong Liu To: dts@dpdk.org Date: Fri, 7 Aug 2015 13:36:10 +0800 Message-Id: <1438925771-32641-4-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1438925771-32641-1-git-send-email-yong.liu@intel.com> References: <1438925771-32641-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH V2 3/4] Move function accepted_nic to dts module 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: Fri, 07 Aug 2015 05:36:25 -0000 From: Marvin Liu This function will use varaiable in dts. Moved to dts module will make settings module independent from it. Signed-off-by: Marvin Liu diff --git a/framework/dut.py b/framework/dut.py index a5c9db3..1199fc6 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -322,7 +322,7 @@ class Dut(Crb): current_nic = 0 for (pci_bus, pci_id) in self.pci_devices_info: - if settings.accepted_nic(pci_id): + if dts.accepted_nic(pci_id): if self.is_ssh_session_port(pci_bus): continue @@ -345,7 +345,7 @@ class Dut(Crb): current_nic = 0 for (pci_bus, pci_id) in self.pci_devices_info: - if settings.accepted_nic(pci_id): + if dts.accepted_nic(pci_id): if self.is_ssh_session_port(pci_bus): continue @@ -671,7 +671,7 @@ class Dut(Crb): for (pci_bus, pci_id) in self.pci_devices_info: - if not settings.accepted_nic(pci_id): + if not dts.accepted_nic(pci_id): self.logger.info("DUT: [%s %s] %s" % (pci_bus, pci_id, skipped)) continue diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index 7b6e1ae..e0009d3 100644 --- a/framework/project_dpdk.py +++ b/framework/project_dpdk.py @@ -39,7 +39,7 @@ from crb import Crb from dut import Dut from tester import Tester from logger import getLogger -from settings import IXIA, accepted_nic +from settings import IXIA class DPDKdut(Dut): @@ -112,7 +112,7 @@ class DPDKdut(Dut): binding_list = '' for (pci_bus, pci_id) in self.pci_devices_info: - if accepted_nic(pci_id): + if dts.accepted_nic(pci_id): binding_list += '%s,' % (pci_bus) self.send_expect("kldunload if_ixgbe.ko", "#") diff --git a/framework/settings.py b/framework/settings.py index 631bd32..6b02e4d 100644 --- a/framework/settings.py +++ b/framework/settings.py @@ -33,7 +33,6 @@ Folders for framework running enviornment. """ import re import socket -import dts FOLDERS = { 'Framework': 'framework', @@ -179,23 +178,6 @@ def get_nic_driver(pci_id): return driver -def accepted_nic(pci_id): - """ - Return True if the pci_id is a known NIC card in the settings file and if - it is selected in the execution file, otherwise it returns False. - """ - if pci_id not in NICS.values(): - return False - - if dts.nic is 'any': - return True - - else: - if pci_id == NICS[dts.nic]: - return True - - return False - def get_netdev(crb, pci): for port in crb.ports_info: if pci == port['pci']: -- 1.9.3