aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/pci
AgeCommit message (Collapse)AuthorFilesLines
2024-05-06vlib: fix missing integer initGuillaume Solignac1-4/+4
Some compilers were not clever enough to figure out these inits weren't needed. Hence adding them. Type: fix Signed-off-by: Guillaume Solignac <gsoligna@cisco.com> Change-Id: I50c4e978bfd2ef15ece7a29e517bb8ddba12f960 Signed-off-by: Pierre Pfister <ppfister@cisco.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-04-22vlib: Place linux pci headers in a linux include blockTom Jones1-0/+2
Type: improvement Change-Id: I6b30ffd1eabfa9544d548082b7e38b8fe7224c07 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-12misc: remove GNU Indent directivesDamjan Marion1-2/+0
Type: refactor Change-Id: I5235bf3e9aff58af6ba2c14e8c6529c4fc9ec86c Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-02dev: new device driver infraDamjan Marion1-0/+5
Type: feature Change-Id: I20c56e0d3103624407f18365c2bc1273dea5c199 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-13vlib: allow unpriviledged vlib_pci_get_device_info()Damjan Marion1-2/+2
When running unpriviledged sysfs allows reading only first 64 bytes of PCI config space. Change-Id: I62d18328925a2e4936406c2842154b20182cacb9 Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-09-13vlib: deuglify the offset finding loop in pci.cVratko Polak1-5/+2
Type: style Fixes: 054229ebbdeb3f87d96c1abf93b511c86cd6ff0f Change-Id: I7c3080db94566af249e5082d59a4e6373c616888 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-09-13pci: fix coverity issue CID-322372Dave Wallace1-1/+1
Type: fix Change-Id: Iaf16bb720d76ea3ae04afb8123b7cac15771ef2b Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-07-28vlib: fix gcc build breakageDave Wallace1-1/+3
Type: fix Fixes: 00ea98ad6 Change-Id: I4ac8c9c5902299d5f283ba4912d52d9bfcedef5c Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-07-28vlib: pci cleanup and improvementsDamjan Marion3-400/+472
Change-Id: Ieafbed6f2db3dec65e4b43d84a4661f6a1bbe891 Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-01-11pci: add option to force uio bindingBenoît Ganne1-2/+2
Type: improvement Change-Id: Ifea4badd58f7e2b5e792d7506f6747851a08587f Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-11-08perfmon: fix iio-bw coverity issuesRay Kinsella1-1/+1
Fixes an number of coverity issues associated with the iio-bw feature. Type: fix Fixes: e15c999c3 Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I9ad2b336694132545d90a3483200a510226e9198
2021-11-02vlib: retrieve the root bus of a given pci deviceRay Kinsella2-3/+11
Added a function to parse sysfs, determine the root bus & domain of a given pci device. Type: improvement Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I36778116ecaa2d591617450fe5ae0bdb46b4424b
2021-11-02vlib: add format pci link portRay Kinsella2-0/+14
Added a function to nicely format pci link ports. Similar to the existing link_speed etc format functions. Type: improvement Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: Ic1f104e0cb34dad274f6c959e776a32c0bab697d
2021-03-11misc: fix gcc-11 buildDamjan Marion1-16/+13
Type: fix Change-Id: Ia17c8255806a2575bb75ed37050b47ddb347050c Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-11-25pci: add PCIe Gen4 link speedDamjan Marion1-2/+4
Type: improvement Change-Id: Iccf4fabe912ab7ac45b6fc082824a67d4fd9f216 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-08pci: add vlib_pci_get_msix_file_indexDamjan Marion1-0/+2
Type: improvement Change-Id: Ibc15aa6f75e989b2b7caa9a57e3665b1ffc7cc18 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-03-31vlib: move pci api types from vnet/pci to vlib/pciJakub Grajciar3-0/+96
Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I1a60809a8bbbbb8ac8b65ab990d51aae1229647f Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-12-17vlib: fix an issue with show pciVratko Polak1-1/+1
The fix has been received over e-mail from Lijian Zhang. https://lists.fd.io/g/vpp-dev/message/14808 Type: fix Ticket: VPP-1805 Change-Id: I73e5fe7dcbe2b0b1c639d844f29183eab3b6dd66 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-01-31pci: get the number of interruptsMohsin Kazmi1-0/+3
Change-Id: I2cfb81b3c8809d027a3ee5f5f570668e60be08ef Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-01-07avf: allocate descriptor memory from local numaDamjan Marion1-0/+1
Change-Id: Ic56ee4ce83b282a5f0f5aed500721fe639b941b3 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-23vlib: Add support for pci io read/writeMohsin Kazmi1-12/+29
Change-Id: I9d96e7782a12c2e19eacbb75edb1fb450cf33bed Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-10-23Numa-aware, growable physical memory allocator (pmalloc)Damjan Marion1-0/+5
Change-Id: Ic4c46bc733afae8bf0d8146623ed15633928de30 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-22vlib: pci improvementsDamjan Marion2-39/+52
- logging - pass vlib_main_t to all APIs - open vfio container only when needed Change-Id: I897e53e0af3f91c3a99f0c827401d1c0ec2e478a Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-09plugins: unload plugin if early init failsDamjan Marion1-0/+8
Change-Id: I32f68e2ee8f5d32962acdefb0193583f71d342b3 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-26vlib: add support for vfio no-iommu modeDamjan Marion1-0/+3
Change-Id: Ic83971d8d9d8d0bb90a35932e60761cd728457f3 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-05vlib: add functions to dynamically open/close PCI deviceDamjan Marion1-0/+5
Old code was only allowing PCIdevices to be scanned during startup, now driver can open and close device without restart of vpp. Change-Id: I1a06511e3f16f896101b43dac2bad420b6e6c35e Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-05vlib: rework PCI INTx supportDamjan Marion1-0/+3
Change-Id: I6df5a01416993c213e06645a6d9b48dfe77c8227 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-04vlib: add PCI MSI-X interrupt support (vfio only)Damjan Marion1-1/+14
Change-Id: Iae2ddf93d1705354175e3dcae26b66e6f98a5c32 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-04vlib: map pci region by using vfio FD when vfio is usedDamjan Marion1-5/+5
Change-Id: Ib94e9e9e9fcdad9cdb0e3402b3de7d78bd644abe Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-26vlib: fix formatting in pci_config.hDamjan Marion1-103/+111
Change-Id: I5ce40f82e42be19f0f4d882ab194e5a25980adc1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-12-09vlib: PCI rework to support VFIODamjan Marion2-93/+110
Also fixes old ixge driver, so it works with recent physmem changes and vfio. Change-Id: Id4be74b34daed47cd281a77eec43d6692340d882 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-11-28net/virtio: support modern device idGabriel Ganne1-0/+7
Add legacy and modern macros to pci_config header. This follows dpdk commit: 4c7903658f6b5a8f4901224ef405445541b91e4a And PCI Device Conformance doc : docs.oasis-open.org/virtio/virtio/v1.0/cs02/virtio-v1.0-cs02.html#x1-640001 Change-Id: Iacd40ea8c06f220736ca0bc7ce68bcf1e55b68f6 Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2017-10-04[aarch64] Fixes CLI crashes on dpaa2 platform.Christophe Fontaine1-1/+1
- always use 'va_args' as pointer in all format_* functions - u32 for all 'indent' params as it's declaration was inconsistent Change-Id: Ic5799309a6b104c9b50fec309cba789c8da99e79 Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
2017-09-08vlib: move linux-specific code to vlib/linuxDamjan Marion1-665/+0
Change-Id: Id79d2c2be7a98e15416a537c890a8f2dd6d4464d Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-07-10vlib: fix issues with PCI handling codeDamjan Marion2-7/+7
- PCI devices not properly discovered - vlib_pci_bus_master_enable () not working Change-Id: I7433ab1b19b890b8900635b43037b9a2017a1921 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-05-24vlib: use driver_override in sysfs for binding pci devs to vfio/uio driversDamjan Marion1-12/+30
Change-Id: I262e455792fd95d286ee3ebc0049e2352ae5899f Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-05-08vlib: do not unbind devices already bound to vfio-pciDamjan Marion1-0/+5
Change-Id: I739bed5b9d9504d18ee88206e29ebc4ba1b47d28 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion4-0/+1888
Change-Id: I7b51f88292e057c6443b12224486f2d0c9f8ae23 Signed-off-by: Damjan Marion <damarion@cisco.com>
. """This module gets T-Rex advanced stateful (astf) traffic profile together with other parameters, reads the profile and sends the traffic. At the end, it parses for various counters. """ import argparse import json import sys import time sys.path.insert( 0, u"/opt/trex-core-2.97/scripts/automation/trex_control_plane/interactive/" ) from trex.astf.api import ASTFClient, ASTFProfile, TRexError def fmt_latency(lat_min, lat_avg, lat_max, hdrh): """Return formatted, rounded latency. :param lat_min: Min latency :param lat_avg: Average latency :param lat_max: Max latency :param hdrh: Base64 encoded compressed HDRHistogram object. :type lat_min: str :type lat_avg: str :type lat_max: str :type hdrh: str :return: Formatted and rounded output (hdrh unchanged) "min/avg/max/hdrh". :rtype: str """ try: t_min = int(round(float(lat_min))) except ValueError: t_min = int(-1) try: t_avg = int(round(float(lat_avg))) except ValueError: t_avg = int(-1) try: t_max = int(round(float(lat_max))) except ValueError: t_max = int(-1) return u"/".join(str(tmp) for tmp in (t_min, t_avg, t_max, hdrh)) def simple_burst( profile_file, duration, framesize, n_data_frames, multiplier, port_0, port_1, latency, async_start=False, traffic_directions=2, delay=0.0, ): """Send traffic and measure packet loss and latency. Procedure: - reads the given traffic profile with streams, - connects to the T-rex astf client, - resets the ports, - removes all existing streams, - adds streams from the traffic profile to the ports, - clears the statistics from the client, - starts the traffic, - waits for the defined time (or runs forever if async mode is defined), - explicitly stops the traffic, - reads and displays the statistics and - disconnects from the client. Duration details: Contrary to stateless mode, ASTF profiles typically limit the number of flows/transactions that can happen. The caller is expected to set the duration parameter to idealized value, but set the delay arguments when TRex is expected to finish processing replies later (including a window for latency). See *_traffic_duration output fields for TRex's measurement of the real traffic duration (should be without any inactivity overheads). If traffic has not ended by the final time, the traffic is stopped explicitly, counters reflect the state just after the stop. TODO: Support tests which focus only on some transaction phases, e.g. TCP tests ignoring init and teardown separated by delays. Currently, approximated time measures the whole traffic duration. :param profile_file: A python module with T-rex traffic profile. :param duration: Expected duration for all transactions to finish, without any TRex related delays, without even latency. :param framesize: Frame size. :param n_data_frames: Controls "size" of transaction for TPUT tests. :param multiplier: Multiplier of profile CPS. :param port_0: Port 0 on the traffic generator. :param port_1: Port 1 on the traffic generator. :param latency: With latency stats. :param async_start: Start the traffic and exit. :param traffic_directions: Bidirectional (2) or unidirectional (1) traffic. :param delay: Time increase [s] for sleep duration. :type profile_file: str :type duration: float :type framesize: int or str :type n_data_frames: int :type multiplier: int :type port_0: int :type port_1: int :type latency: bool :type async_start: bool :type traffic_directions: int :type delay: float """ client = None total_received = 0 total_sent = 0 lost_a = 0 lost_b = 0 lat_a = u"-1/-1/-1/" lat_b = u"-1/-1/-1/" lat_a_hist = u"" lat_b_hist = u"" l7_data = u"" stats = dict() approximated_duration = 0 # Read the profile. try: # TODO: key-values pairs to the profile file # - ips ? print(f"### Profile file:\n{profile_file}") profile = ASTFProfile.load( profile_file, framesize=framesize, n_data_frames=n_data_frames, ) except TRexError: print(f"Error while loading profile '{profile_file}'!") raise try: # Create the client. client = ASTFClient() # Connect to server client.connect() # Acquire ports, stop the traffic, remove loaded traffic and clear # stats. client.reset() # Load the profile. client.load_profile(profile) ports = [port_0] if traffic_directions > 1: ports.append(port_1) # Clear the stats before injecting. lost_a = 0 lost_b = 0 stats = dict() # Choose CPS and start traffic. client.start( mult=multiplier, duration=duration, nc=True, latency_pps=int(multiplier) if latency else 0, client_mask=2**len(ports)-1, ) time_stop = time.monotonic() + duration + delay if async_start: # For async stop, we need to export the current snapshot. xsnap0 = client.ports[port_0].get_xstats().reference_stats print(f"Xstats snapshot 0: {xsnap0!r}") if traffic_directions > 1: xsnap1 = client.ports[port_1].get_xstats().reference_stats print(f"Xstats snapshot 1: {xsnap1!r}") else: time.sleep(duration + delay) # Do not block yet, the existing transactions may take long time # to finish. We need an action that is almost reset(), # but without clearing stats. client.stop(block=False) client.stop_latency() client.remove_rx_queue(client.get_all_ports()) # Now we can wait for the real traffic stop. client.stop(block=True) # Read the stats after the traffic stopped (or time up). stats[time.monotonic() - time_stop] = client.get_stats( ports=ports ) if client.get_warnings(): for warning in client.get_warnings(): print(warning) # Now finish the complete reset. client.reset() print(u"##### Statistics #####") print(json.dumps(stats, indent=4, separators=(u",", u": "))) approximated_duration = list(sorted(stats.keys()))[-1] stats = stats[sorted(stats.keys())[-1]] lost_a = stats[port_0][u"opackets"] - stats[port_1][u"ipackets"] if traffic_directions > 1: lost_b = stats[port_1][u"opackets"] - stats[port_0][u"ipackets"] # TODO: Latency measurement not used at this phase. This part will # be aligned in another commit. # Stats index is not a port number, but "pgid". if latency: lat_obj = stats[u"latency"][0][u"hist"] # TODO: Latency histogram is dictionary in astf mode, # needs additional processing lat_a = fmt_latency( str(lat_obj[u"min_usec"]), str(lat_obj[u"s_avg"]), str(lat_obj[u"max_usec"]), u"-") lat_a_hist = str(lat_obj[u"histogram"]) if traffic_directions > 1: lat_obj = stats[u"latency"][1][u"hist"] lat_b = fmt_latency( str(lat_obj[u"min_usec"]), str(lat_obj[u"s_avg"]), str(lat_obj[u"max_usec"]), u"-") lat_b_hist = str(lat_obj[u"histogram"]) if traffic_directions > 1: total_sent = \ stats[port_0][u"opackets"] + stats[port_1][u"opackets"] total_received = \ stats[port_0][u"ipackets"] + stats[port_1][u"ipackets"] client_sent = stats[port_0][u"opackets"] client_received = stats[port_0][u"ipackets"] client_stats = stats[u"traffic"][u"client"] server_stats = stats[u"traffic"][u"server"] # Some zero counters are not sent # Active and established flows UDP/TCP # Client c_act_flows = client_stats[u"m_active_flows"] c_est_flows = client_stats[u"m_est_flows"] c_traffic_duration = client_stats.get(u"m_traffic_duration", 0) l7_data = f"client_active_flows={c_act_flows}; " l7_data += f"client_established_flows={c_est_flows}; " l7_data += f"client_traffic_duration={c_traffic_duration}; " # Possible errors # Too many packets in NIC rx queue c_err_rx_throttled = client_stats.get(u"err_rx_throttled", 0) l7_data += f"client_err_rx_throttled={c_err_rx_throttled}; " # Number of client side flows that were not opened # due to flow-table overflow c_err_nf_throttled = client_stats.get(u"err_c_nf_throttled", 0) l7_data += f"client_err_nf_throttled={c_err_nf_throttled}; " # Too many flows c_err_flow_overflow = client_stats.get(u"err_flow_overflow", 0) l7_data += f"client_err_flow_overflow={c_err_flow_overflow}; " # Server s_act_flows = server_stats[u"m_active_flows"] s_est_flows = server_stats[u"m_est_flows"] s_traffic_duration = server_stats.get(u"m_traffic_duration", 0) l7_data += f"server_active_flows={s_act_flows}; " l7_data += f"server_established_flows={s_est_flows}; " l7_data += f"server_traffic_duration={s_traffic_duration}; " # Possible errors # Too many packets in NIC rx queue s_err_rx_throttled = server_stats.get(u"err_rx_throttled", 0) l7_data += f"client_err_rx_throttled={s_err_rx_throttled}; " if u"udp" in profile_file: # Client # Established connections c_udp_connects = client_stats.get(u"udps_connects", 0) l7_data += f"client_udp_connects={c_udp_connects}; " # Closed connections c_udp_closed = client_stats.get(u"udps_closed", 0) l7_data += f"client_udp_closed={c_udp_closed}; " # Sent bytes c_udp_sndbyte = client_stats.get(u"udps_sndbyte", 0) l7_data += f"client_udp_tx_bytes={c_udp_sndbyte}; " # Sent packets c_udp_sndpkt = client_stats.get(u"udps_sndpkt", 0) l7_data += f"client_udp_tx_packets={c_udp_sndpkt}; " # Received bytes c_udp_rcvbyte = client_stats.get(u"udps_rcvbyte", 0) l7_data += f"client_udp_rx_bytes={c_udp_rcvbyte}; " # Received packets c_udp_rcvpkt = client_stats.get(u"udps_rcvpkt", 0) l7_data += f"client_udp_rx_packets={c_udp_rcvpkt}; " # Keep alive drops c_udp_keepdrops = client_stats.get(u"udps_keepdrops", 0) l7_data += f"client_udp_keep_drops={c_udp_keepdrops}; " # Client without flow c_err_cwf = client_stats.get(u"err_cwf", 0) l7_data += f"client_err_cwf={c_err_cwf}; " # Server # Accepted connections s_udp_accepts = server_stats.get(u"udps_accepts", 0) l7_data += f"server_udp_accepts={s_udp_accepts}; " # Closed connections s_udp_closed = server_stats.get(u"udps_closed", 0) l7_data += f"server_udp_closed={s_udp_closed}; " # Sent bytes s_udp_sndbyte = server_stats.get(u"udps_sndbyte", 0) l7_data += f"server_udp_tx_bytes={s_udp_sndbyte}; " # Sent packets s_udp_sndpkt = server_stats.get(u"udps_sndpkt", 0) l7_data += f"server_udp_tx_packets={s_udp_sndpkt}; " # Received bytes s_udp_rcvbyte = server_stats.get(u"udps_rcvbyte", 0) l7_data += f"server_udp_rx_bytes={s_udp_rcvbyte}; " # Received packets s_udp_rcvpkt = server_stats.get(u"udps_rcvpkt", 0) l7_data += f"server_udp_rx_packets={s_udp_rcvpkt}; " elif u"tcp" in profile_file: # Client # Connection attempts c_tcp_connattempt = client_stats.get(u"tcps_connattempt", 0) l7_data += f"client_tcp_connattempt={c_tcp_connattempt}; " # Established connections c_tcp_connects = client_stats.get(u"tcps_connects", 0) l7_data += f"client_tcp_connects={c_tcp_connects}; " # Closed connections c_tcp_closed = client_stats.get(u"tcps_closed", 0) l7_data += f"client_tcp_closed={c_tcp_closed}; " # Send bytes c_tcp_sndbyte = client_stats.get(u"tcps_sndbyte", 0) l7_data += f"client_tcp_tx_bytes={c_tcp_sndbyte}; " # Received bytes c_tcp_rcvbyte = client_stats.get(u"tcps_rcvbyte", 0) l7_data += f"client_tcp_rx_bytes={c_tcp_rcvbyte}; " # Server # Accepted connections s_tcp_accepts = server_stats.get(u"tcps_accepts", 0) l7_data += f"server_tcp_accepts={s_tcp_accepts}; " # Established connections s_tcp_connects = server_stats.get(u"tcps_connects", 0) l7_data += f"server_tcp_connects={s_tcp_connects}; " # Closed connections s_tcp_closed = server_stats.get(u"tcps_closed", 0) l7_data += f"server_tcp_closed={s_tcp_closed}; " # Sent bytes s_tcp_sndbyte = server_stats.get(u"tcps_sndbyte", 0) l7_data += f"server_tcp_tx_bytes={s_tcp_sndbyte}; " # Received bytes s_tcp_rcvbyte = server_stats.get(u"tcps_rcvbyte", 0) l7_data += f"server_tcp_rx_bytes={s_tcp_rcvbyte}; " else: total_sent = stats[port_0][u"opackets"] total_received = stats[port_1][u"ipackets"] print(f"packets lost from {port_0} --> {port_1}: {lost_a} pkts") if traffic_directions > 1: print(f"packets lost from {port_1} --> {port_0}: {lost_b} pkts") except TRexError: print(u"T-Rex ASTF runtime error!", file=sys.stderr) raise finally: if client: if async_start: client.disconnect(stop_traffic=False, release_ports=True) else: client.clear_profile() client.disconnect() print( f"multiplier={multiplier!r}; " f"total_received={total_received}; " f"total_sent={total_sent}; " f"frame_loss={lost_a + lost_b}; " f"approximated_duration={approximated_duration}; " f"latency_stream_0(usec)={lat_a}; " f"latency_stream_1(usec)={lat_b}; " f"latency_hist_stream_0={lat_a_hist}; " f"latency_hist_stream_1={lat_b_hist}; " f"client_sent={client_sent}; " f"client_received={client_received}; " f"{l7_data}" ) def main(): """Main function for the traffic generator using T-rex. It verifies the given command line arguments and runs "simple_burst" function. """ parser = argparse.ArgumentParser() parser.add_argument( u"-p", u"--profile", required=True, type=str, help=u"Python traffic profile." ) parser.add_argument( u"-d", u"--duration", required=True, type=float, help=u"Duration of the whole traffic run, including overheads." ) parser.add_argument( u"-s", u"--frame_size", required=True, help=u"Size of a Frame without padding and IPG." ) parser.add_argument( u"--n_data_frames", type=int, default=5, help=u"Use this many data frames per transaction and direction (TPUT)." ) parser.add_argument( u"-m", u"--multiplier", required=True, type=float, help=u"Multiplier of profile CPS." ) parser.add_argument( u"--port_0", required=True, type=int, help=u"Port 0 on the traffic generator." ) parser.add_argument( u"--port_1", required=True, type=int, help=u"Port 1 on the traffic generator." ) parser.add_argument( u"--async_start", action=u"store_true", default=False, help=u"Non-blocking call of the script." ) parser.add_argument( u"--latency", action=u"store_true", default=False, help=u"Add latency stream." ) parser.add_argument( u"--traffic_directions", type=int, default=2, help=u"Send bi- (2) or uni- (1) directional traffic." ) parser.add_argument( u"--delay", required=True, type=float, default=0.0, help=u"Allowed time overhead, sleep time is increased by this [s]." ) args = parser.parse_args() try: framesize = int(args.frame_size) except ValueError: framesize = args.frame_size simple_burst( profile_file=args.profile, duration=args.duration, framesize=framesize, n_data_frames=args.n_data_frames, multiplier=args.multiplier, port_0=args.port_0, port_1=args.port_1, latency=args.latency, async_start=args.async_start, traffic_directions=args.traffic_directions, delay=args.delay, ) if __name__ == u"__main__": main()