summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-11-06 17:20:17 +0200
committerimarom <imarom@cisco.com>2016-11-06 17:20:17 +0200
commita1ade6fd8e044b9866a8644db3519305539cfc61 (patch)
tree08b4d0e2db80c4d1e5cb759512c5e3631c19fd95 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
parent234779fd32e747f4ac918f3c39e59618dde0f2d7 (diff)
RX features - RX sniffer
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py37
1 files changed, 30 insertions, 7 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
index 59793495..571a6e16 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
@@ -252,6 +252,10 @@ class Port(object):
# attributes
self.attr = rc.data()['attr']
+
+ # rx info
+ self.rx_info = rc.data()['rx_info']
+
return self.ok()
@@ -484,18 +488,15 @@ class Port(object):
return self.ok()
- #
+
@writeable
- def start_rx_capture (self, pcap_filename, limit):
-
- prefix, suffix = pcap_filename.split('.')
- filename = "{0}-{1}.{2}".format(prefix, self.port_id, suffix)
+ def set_rx_sniffer (self, pcap_filename, limit):
params = {"handler": self.handler,
"port_id": self.port_id,
"type": "capture",
"enabled": True,
- "pcap_filename": filename,
+ "pcap_filename": pcap_filename,
"limit": limit}
rc = self.transmit("set_rx_feature", params)
@@ -679,6 +680,10 @@ class Port(object):
# generate formatted (console friendly) port info
def get_formatted_info (self):
+
+ # sync the attributes
+ self.sync()
+
info = dict(self.info)
info['status'] = self.get_port_state_name()
@@ -726,7 +731,22 @@ class Port(object):
else:
info['speed'] = 'N/A'
- info['rx_filter_mode'] = self.attr.get('rx_filter_mode', 'N/A')
+
+ # RX info
+ if 'rx_filter_mode' in self.attr:
+ info['rx_filter_mode'] = 'Hardware Match' if self.attr['rx_filter_mode'] == 'hw' else 'Fetch All'
+ else:
+ info['rx_filter_mode'] = 'N/A'
+
+ if 'sniffer' in self.rx_info:
+ sniffer = self.rx_info['sniffer']
+ if sniffer['is_active']:
+ info['rx_sniffer'] = '{0}\n[{1} / {2}]'.format(sniffer['pcap_filename'], sniffer['count'], sniffer['limit'])
+ else:
+ info['rx_sniffer'] = 'off'
+ else:
+ info['rx_sniffer'] = 'N/A'
+
return info
@@ -759,6 +779,9 @@ class Port(object):
"flow ctrl" : info['fc'],
"RX Filter Mode": info['rx_filter_mode'],
+ "RX Queueing": 'off',
+ "RX sniffer": info['rx_sniffer'],
+
}
def clear_stats(self):