From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH 1/3] nics fm10k: fix nic object incorrect issue
Date: Wed, 20 Jan 2016 16:41:19 +0800 [thread overview]
Message-ID: <1453279281-15206-1-git-send-email-yong.liu@intel.com> (raw)
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 <yong.liu@intel.com>
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
next reply other threads:[~2016-01-20 8:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-20 8:41 Yong Liu [this message]
2016-01-20 8:41 ` [dts] [PATCH 2/3] framework settings: add atwood channel support Yong Liu
2016-01-20 8:41 ` [dts] [PATCH 3/3] tests: support atwood in suites Yong Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1453279281-15206-1-git-send-email-yong.liu@intel.com \
--to=yong.liu@intel.com \
--cc=dts@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).