v2.08
authorHanoh Haim <[email protected]>
Wed, 24 Aug 2016 13:30:03 +0000 (16:30 +0300)
committerHanoh Haim <[email protected]>
Wed, 24 Aug 2016 13:30:03 +0000 (16:30 +0300)
VERSION
scripts/automation/trex_control_plane/doc_stl/api/client_code.rst

diff --git a/VERSION b/VERSION
index 2f0fe9c..c86c033 100755 (executable)
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
-v2.07
+v2.08
 
 
 
index 165a9a0..08720e8 100755 (executable)
@@ -14,6 +14,10 @@ In addition to the Python API, a console-based API interface is also available.
 Python-like example::
     
    c.start(ports = [0, 1], mult = "5mpps", duration = 10)
+
+   c.start(ports = [0, 1], mult = "5mpps", duration = 10, core_mask = [0x1,0xe] )
+
+   c.start(ports = [0, 1], mult = "5mpps", duration = 10, core_mask = core_mask=STLClient.CORE_MASK_PIN )
    
 Console-like example::
 
@@ -96,6 +100,7 @@ STLClient snippet
         c.disconnect()
 
 
+
 .. code-block:: python
     :caption: Example 2: Client can execute other functions while the TRex server is generating traffic
 
@@ -218,3 +223,34 @@ Example 4: Load profile from a file::
         c.disconnect()
         
 
+.. code-block:: python
+    :caption: Example 5: pin cores to ports
+
+    c = STLClient()
+
+    try:
+        # connect to server
+        c.connect()
+
+        # prepare our ports (my machine has 0 <--> 1 with static route)
+        c.reset(ports = [0, 1])
+
+        # add both streams to ports
+        c.add_streams(s1, ports = [0])
+
+        # clear the stats before injecting
+        c.clear_stats()
+
+        c.start(ports = [0, 1], mult = "5mpps", duration = 10, core_mask = [0x1,0x2]) # pin core to ports for better performance 
+
+        # block until done
+        c.wait_on_traffic(ports = [0, 1])
+
+        # check for any warnings
+       if c.get_warnings():
+           # handle warnings here
+           pass
+
+    finally:
+        c.disconnect()
+