test suite reviews and discussions
 help / color / mirror / Atom feed
From: Qian Xu <qian.q.xu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH] enable promisc for tester's port and add fvl10g vf setting.
Date: Tue,  5 Jan 2016 16:40:46 +0800	[thread overview]
Message-ID: <1451983246-13663-1-git-send-email-qian.q.xu@intel.com> (raw)

Signed-off-by: Qian Xu <qian.q.xu@intel.com>

Add set_promisc for tester's ports since in virtualization case, we need check the received packets at the tester's port, need enable promisc mode first to catch all the packets. 
For FVL10g vf automation case, we add fvl10g driver settings:device id and driver name.


diff --git a/framework/crb.py b/framework/crb.py
index 525d6a1..a3a7bba 100644
--- a/framework/crb.py
+++ b/framework/crb.py
@@ -697,3 +697,7 @@ class Crb(object):
         for port_info in self.ports_info:
             if port_info['pci'] == pci:
                 return port_info
+    
+    def enable_promisc(self,intf):
+        if intf !='N/A':
+            self.send_expect("ifconfig %s promisc" %intf, "# ",alt_session=True)
diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index 538a3b7..597982f 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -382,6 +382,7 @@ class DPDKtester(Tester):
 
         self.tester_prerequisites()
 
+        self.set_promisc()
         # use software pktgen for performance test
         if perf_test is True:
             try:
diff --git a/framework/settings.py b/framework/settings.py
index 0b658f2..02759f7 100644
--- a/framework/settings.py
+++ b/framework/settings.py
@@ -76,6 +76,7 @@ NICS = {
     'fortville_spirit_single': '8086:1584',
     'redrockcanyou': '8086:15a4',
     'fortpark':'8086:374c',
+    'fvl10g_vf':'8086:154c'
 }
 
 DRIVERS = {
@@ -107,6 +108,7 @@ DRIVERS = {
     'fortville_spirit': 'i40e',
     'fortville_spirit_single': 'i40e',
     'redrockcanyou': 'fm10k',
+    'fvl10g_vf':'i40evf'
 }
 
 """
diff --git a/framework/tester.py b/framework/tester.py
index 210d54f..08a3c75 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -211,6 +211,17 @@ class Tester(Crb):
 
         sleep(2)
 
+    def set_promisc(self):
+        try:
+            for (pci_bus, pci_id) in self.pci_devices_info:
+                addr_array = pci_bus.split(':')
+                port = NetDevice(self, addr_array[0], addr_array[1])
+                itf = port.get_interface_name()
+                self.enable_promisc(itf)
+        except Exception as e:
+            pass
+
+
     def load_serializer_ports(self):
         cached_ports_info = self.serializer.load(self.PORT_INFO_CACHE_KEY)
         if cached_ports_info is None:
-- 
2.1.0

             reply	other threads:[~2016-01-05  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05  8:40 Qian Xu [this message]
2016-01-06  7:31 ` Liu, Yong

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=1451983246-13663-1-git-send-email-qian.q.xu@intel.com \
    --to=qian.q.xu@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).