From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 7DCEF8D36 for ; Wed, 20 Jan 2016 09:41:33 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 20 Jan 2016 00:41:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,320,1449561600"; d="scan'208";a="864512934" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 20 Jan 2016 00:41:26 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id u0K8fOYb028437; Wed, 20 Jan 2016 16:41:24 +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 u0K8fL23015242; Wed, 20 Jan 2016 16:41:23 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id u0K8fL85015238; Wed, 20 Jan 2016 16:41:21 +0800 From: Yong Liu To: dts@dpdk.org Date: Wed, 20 Jan 2016 16:41:19 +0800 Message-Id: <1453279281-15206-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dts] [PATCH 1/3] nics fm10k: fix nic object incorrect issue 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, 20 Jan 2016 08:41:34 -0000 This issue happened at dut/tester have same pci address net device. Net_device module check they will be same devices, so will return incorrect net device object. Signed-off-by: Marvin Liu diff --git a/framework/dts.py b/framework/dts.py index 1e60a01..6c3808b 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -39,6 +39,7 @@ import atexit # register callback when exit import json # json format import signal # signal module for debug mode import time # time module for unique output folder +import copy # copy module for duplicate variable import rst # rst file support import sys # system module @@ -252,8 +253,12 @@ def dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir, nic, virtt '/.%s.cache' % crbInst['IP']) serializer.load_from_file() - dut = get_project_obj(project, Dut, crbInst, serializer) - tester = get_project_obj(project, Tester, crbInst, serializer) + dutInst = copy.copy(crbInst) + dutInst['My IP'] = crbInst['IP'] + dut = get_project_obj(project, Dut, dutInst, serializer) + testInst = copy.copy(crbInst) + testInst['My IP'] = crbInst['tester IP'] + tester = get_project_obj(project, Tester, testInst, serializer) dts_log_execution(log_handler) dut.tester = tester tester.dut = dut diff --git a/framework/packet.py b/framework/packet.py index a7853e9..b151021 100755 --- a/framework/packet.py +++ b/framework/packet.py @@ -196,7 +196,7 @@ class scapy(object): if element == 'src': value = layer.sport elif element == 'dst': - valude = layer.dport + value = layer.dport return value diff --git a/nics/net_device.py b/nics/net_device.py index c3b3755..0286aa4 100644 --- a/nics/net_device.py +++ b/nics/net_device.py @@ -820,7 +820,7 @@ def GetNicObj(crb, bus_id, devfun_id): object different from default. """ # find existed NetDevice object - obj = get_from_list(crb.crb['IP'], bus_id, devfun_id) + obj = get_from_list(crb.crb['My IP'], bus_id, devfun_id) if obj: return obj @@ -831,8 +831,12 @@ def GetNicObj(crb, bus_id, devfun_id): # redrockcanyou nic need special initialization from fm10k import RedRockCanyou obj = RedRockCanyou(crb, bus_id, devfun_id) + elif nic == 'atwood': + # atwood nic need special initialization + from atwood import Atwood + obj = Atwood(crb, bus_id, devfun_id) else: obj = NetDevice(crb, bus_id, devfun_id) - add_to_list(crb.crb['IP'], obj) + add_to_list(crb.crb['My IP'], obj) return obj -- 2.4.3