From 0337db2b07c2c054ee5c5ea49cab6cfce5d5a897 Mon Sep 17 00:00:00 2001 From: imarom Date: Mon, 31 Oct 2016 11:58:27 +0200 Subject: draft: RX software feature Signed-off-by: imarom --- .../stl/trex_stl_lib/trex_stl_client.py | 7 +++++- .../stl/trex_stl_lib/trex_stl_port.py | 27 ++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib') diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py index 80a4c4dc..2e3f681c 100755 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py @@ -1739,6 +1739,10 @@ class STLClient(object): """ + rc = self.ports[0].set_rx_filter_mode("all") + if not rc: + raise STLError(rc) + self.logger.pre_cmd("Pinging the server on '{0}' port '{1}': ".format(self.connection_info['server'], self.connection_info['sync_port'])) rc = self._transmit("ping", api_class = None) @@ -3267,12 +3271,13 @@ class STLClient(object): return self.set_port_attr(opts.ports, opts.prom, opts.link, opts.led, opts.flow_ctrl) + @__console def show_profile_line (self, line): '''Shows profile information''' parser = parsing_opts.gen_parser(self, - "port", + "profile", self.show_profile_line.__doc__, parsing_opts.FILE_PATH) 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 cec3761f..bf0251b8 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 @@ -487,6 +487,21 @@ class Port(object): return self.ok() + @writeable + def set_rx_filter_mode (self, filter_mode): + assert(filter_mode in ["hw", "all"]) + + params = {"handler": self.handler, + "port_id": self.port_id, + "type": "filter_mode", + "filter_type": filter_mode} + + rc = self.transmit("set_rx_feature", params) + if rc.bad(): + return self.err(rc.err()) + + return self.ok() + @owned def pause (self): @@ -583,6 +598,18 @@ class Port(object): return self.ok() + @owned + def get_rx_sw_pkts (self): + params = {"handler": self.handler, + "port_id": self.port_id} + + rc = self.transmit("get_rx_sw_pkts", params) + if rc.bad(): + return self.err(rc.err()) + + return self.ok() + + @writeable def push_remote (self, pcap_filename, ipg_usec, speedup, count, duration, is_dual, slave_handler): -- cgit 1.2.3-korg