diff options
author | 2016-02-28 14:32:57 +0200 | |
---|---|---|
committer | 2016-02-28 14:33:26 +0200 | |
commit | 21fe2befe8806ac2a70cfb1d1c45737bee7e2702 (patch) | |
tree | 4a774d3a156f3418ea22a2ad88602056eb77fab6 /scripts/automation/trex_control_plane/stl/trex_stl_lib | |
parent | b83eb43c25f0452c152d31966da4b1af5c304a6b (diff) |
more info for ports (API and TUI)
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib')
3 files changed, 27 insertions, 21 deletions
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 a241fe1b..3cfef087 100644 --- 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 @@ -663,17 +663,13 @@ class STLClient(object): # create ports for port_id in xrange(self.system_info["port_count"]): - speed = self.system_info['ports'][port_id]['speed'] - driver = self.system_info['ports'][port_id]['driver'] - macaddr = self.system_info['ports'][port_id]['macaddr'] + info = self.system_info['ports'][port_id] self.ports[port_id] = Port(port_id, - speed, - driver, - macaddr, self.username, self.comm_link, - self.session_id) + self.session_id, + info) # sync the ports 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 f2d4cd95..6aa18847 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 @@ -41,7 +41,7 @@ class Port(object): STATE_PAUSE: "PAUSE"} - def __init__ (self, port_id, speed, driver, macaddr, user, comm_link, session_id): + def __init__ (self, port_id, user, comm_link, session_id, info): self.port_id = port_id self.state = self.STATE_IDLE self.handler = None @@ -49,9 +49,9 @@ class Port(object): self.transmit = comm_link.transmit self.transmit_batch = comm_link.transmit_batch self.user = user - self.driver = driver - self.speed = speed - self.macaddr = macaddr + + self.info = dict(info) + self.streams = {} self.profile = None self.session_id = session_id @@ -69,7 +69,7 @@ class Port(object): return RC_OK(data) def get_speed_bps (self): - return (self.speed * 1000 * 1000 * 1000) + return (self.info['speed'] * 1000 * 1000 * 1000) # take the port def acquire(self, force = False): @@ -520,11 +520,9 @@ class Port(object): # generate port info def get_info (self): - info = {} - info['speed'] = self.speed - info['driver'] = self.driver - info['status'] = self.get_port_state_name() - info['macaddr'] = self.macaddr + info = dict(self.info) + + info['status'] = self.get_port_state_name() if self.attr.get('promiscuous'): info['prom'] = "on" if self.attr['promiscuous']['enabled'] else "off" @@ -545,8 +543,14 @@ class Port(object): info = self.get_info() - return {"type": info['driver'], - "macaddr": info['macaddr'], + return {"driver": info['driver'], + "HW src mac": info['hw_macaddr'], + "SW src mac": info['src_macaddr'], + "SW dst mac": info['dst_macaddr'], + "PCI Address": info['pci_addr'], + "NUMA Node": info['numa'], + "--": "", + "---": "", "maximum": "{speed} Gb/s".format(speed=info['speed']), "status": info['status'], "promiscuous" : info['prom'] diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py index ec5435a3..620ccacd 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py @@ -180,11 +180,17 @@ class CTRexInfoGenerator(object): relevant_ports = self.__get_relevant_ports(port_id_list) return_stats_data = {} - per_field_status = OrderedDict([("macaddr", []), - ("type", []), + per_field_status = OrderedDict([("driver", []), ("maximum", []), ("status", []), ("promiscuous", []), + ("--", []), + ("HW src mac", []), + ("SW src mac", []), + ("SW dst mac", []), + ("---", []), + ("PCI Address", []), + ("NUMA Node", []), ] ) |