test suite reviews and discussions
 help / color / mirror / Atom feed
From: Jun Dong <junx.dong@intel.com>
To: junx.dong@intel.com
Cc: dts@dpdk.org
Subject: [dts] [PATCH V1 4/6] nics/net_device: update NetDevice class after removed fm10k
Date: Tue, 15 Jun 2021 18:46:11 +0800	[thread overview]
Message-ID: <20210615104613.14658-4-junx.dong@intel.com> (raw)
In-Reply-To: <20210615104613.14658-1-junx.dong@intel.com>

 1. update method description base context 
 2. update NetDevice factory function about removed fm10k related NICs.

Signed-off-by: Jun Dong <junx.dong@intel.com>
---
 nics/net_device.py | 26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/nics/net_device.py b/nics/net_device.py
index 98d31237..3ddfc4eb 100644
--- a/nics/net_device.py
+++ b/nics/net_device.py
@@ -954,6 +954,7 @@ def get_from_list(host, domain_id, bus_id, devfun_id):
                 return nic['port']
     return None
 
+
 def remove_from_list(host):
     """
     Remove network device object from global structure
@@ -963,38 +964,25 @@ def remove_from_list(host):
         if host == nic['host']:
             NICS_LIST.remove(nic)
 
+
 def GetNicObj(crb, domain_id, bus_id, devfun_id):
     """
     Get network device object. If network device has been initialized, just
-    return object. Based on nic type, some special nics like RRC will return
-    object different from default.
+    return object.
     """
     # find existed NetDevice object
     obj = get_from_list(crb.crb['My IP'], domain_id, bus_id, devfun_id)
     if obj:
         return obj
 
-    pci_id = get_pci_id(crb, domain_id, bus_id, devfun_id)
-    nic = settings.get_nic_name(pci_id)
-
-    if nic == 'redrockcanyou':
-        # redrockcanyou nic need special initialization
-        from rrc import RedRockCanyou
-        obj = RedRockCanyou(crb, domain_id, bus_id, devfun_id)
-    elif nic == 'atwood':
-        # atwood nic need special initialization
-        from atwood import Atwood
-        obj = Atwood(crb, domain_id, bus_id, devfun_id)
-    elif nic == 'boulderrapid':
-        # atwood nic need special initialization
-        from br import BoulderRapid
-        obj = BoulderRapid(crb, domain_id, bus_id, devfun_id)
-    else:
-        obj = NetDevice(crb, domain_id, bus_id, devfun_id)
+    # generate NetDevice object
+    obj = NetDevice(crb, domain_id, bus_id, devfun_id)
 
+    # save NetDevice object to cache, directly get it from cache next time
     add_to_list(crb.crb['My IP'], obj)
     return obj
 
+
 def RemoveNicObj(crb):
     """
     Remove network device object.
-- 
2.27.0


  parent reply	other threads:[~2021-06-15 10:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 10:46 [dts] [PATCH V1 1/6] dts/*: remove fm10k related modules and patch Jun Dong
2021-06-15 10:46 ` [dts] [PATCH V1 2/6] conf/test_case_checklist: update test case checklist after removed fm10k Jun Dong
2021-06-15 10:46 ` [dts] [PATCH V1 3/6] framework/*: update framework " Jun Dong
2021-06-15 10:46 ` Jun Dong [this message]
2021-06-15 10:46 ` [dts] [PATCH V1 5/6] test_plans/*: update test plan " Jun Dong
2021-06-15 10:46 ` [dts] [PATCH V1 6/6] tests/*: update test suits " Jun Dong
     [not found]   ` <BN9PR11MB527491B1E7491772751169B7EA0F9@BN9PR11MB5274.namprd11.prod.outlook.com>
     [not found]     ` <BN9PR11MB5274CA2BE703D61510E11755EA0F9@BN9PR11MB5274.namprd11.prod.outlook.com>
2021-06-18  6:51       ` Tu, Lijuan

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=20210615104613.14658-4-junx.dong@intel.com \
    --to=junx.dong@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).