test suite reviews and discussions
 help / color / mirror / Atom feed
From: Ding Heng <hengx.ding@intel.com>
To: dts@dpdk.org
Cc: Ding Heng <hengx.ding@intel.com>
Subject: [dts] [PATCH] framework: enable 100G ixia support
Date: Mon, 22 Feb 2016 11:35:29 +0800	[thread overview]
Message-ID: <1456112129-10395-1-git-send-email-hengx.ding@intel.com> (raw)

Signed-off-by: Ding Heng <hengx.ding@intel.com>

diff --git a/framework/config.py b/framework/config.py
index 10624f0..37606de 100644
--- a/framework/config.py
+++ b/framework/config.py
@@ -282,6 +282,8 @@ class IxiaConf(UserConf):
                             ixia_port["port"] = int(m.group(2))
                             ixia_ports.append(ixia_port)
                     ixia_group['Ports'] = ixia_ports
+                elif key == 'ixia_enable_rsfec':
+                    ixia_group['enable_rsfec'] = value
 
             if 'Version' not in ixia_group:
                 print 'ixia configuration file request ixia_version option!!!'
diff --git a/framework/etgen.py b/framework/etgen.py
index 364499c..737a57e 100644
--- a/framework/etgen.py
+++ b/framework/etgen.py
@@ -155,6 +155,7 @@ class IxiaPacketGenerator(SSHConnection):
 
         self.ixiaVersion = ixiaPorts[ixiaRef]["Version"]
         self.ports = ixiaPorts[ixiaRef]["Ports"]
+        self.enable_rsfec = ixiaPorts[ixiaRef]['enable_rsfec']
 
         self.logger.info(self.ixiaVersion)
         self.logger.info(self.ports)
@@ -171,6 +172,11 @@ class IxiaPacketGenerator(SSHConnection):
             if not self.tcl_server_login():
                 self.close()
                 self.session = None
+            for port in self.ports:
+                port['speed'] = self.get_line_rate(self.chasId, port)
+
+    def get_line_rate(self, chasid, port):
+        return self.send_expect("stat getLineSpeed %s %s %s" % (chasid, port['card'], port['port']), '%')
 
     def get_ip_address(self):
         return self.tester.get_ip_address()
@@ -406,6 +412,12 @@ class IxiaPacketGenerator(SSHConnection):
         for item in pList:
             self.add_tcl_cmd("port setFactoryDefaults chasId %d %d" % (
                 item['card'], item['port']))
+            if int(self.get_line_rate(self.chasId, item).strip()) == 100000 and self.enable_rsfec == 'enable':
+                self.add_tcl_cmd("port config -ieeeL1Defaults 0")
+                #self.add_tcl_cmd("ixWritePortsToHardware portList")
+                self.add_tcl_cmd("port config -autonegotiate false")
+                self.add_tcl_cmd("port config -enableRsFec true")
+                self.add_tcl_cmd("port set %d %d %d" % (self.chasId, item['card'], item['port']))
 
             pl.append('[list %d %d %d]' % (self.chasId, item['card'], item['port']))
 
-- 
1.9.3

             reply	other threads:[~2016-02-22  3:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22  3:35 Ding Heng [this message]
2016-02-23  0:54 ` Liu, Yong
2016-02-23  2:03 Ding Heng
2016-02-26  3:06 ` 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=1456112129-10395-1-git-send-email-hengx.ding@intel.com \
    --to=hengx.ding@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).