aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python/vpp_papi
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-09-29 10:01:25 +0000
committerBeno�t Ganne <bganne@cisco.com>2020-09-29 13:34:13 +0000
commit162a296756f3dbead55079e4670973d859df1ef9 (patch)
treec24b836a83a051d809508697ba8871538a0ea040 /src/vpp-api/python/vpp_papi
parentd68faf8559da72aa6ad0526d5a86fb16587b1508 (diff)
virtio: fix modern device queue notify
QUEUE_SELECT and QUEUE_NOTIFY_OFF registers are shared between all workers operating on the same device and operations are not atomic Type: fix Change-Id: Ie017b1bfc7e3b6b4e59029f45db78eeffd9f3aeb Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/python/vpp_papi')
0 files changed, 0 insertions, 0 deletions
ckground-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
Usage Examples
==============


Full-featured interactive shell
-------------------------------

The `client_interactive_example.py` extends and uses the `Cmd <https://docs.python.org/2/library/cmd.html>`_ built in python class to create a Full-featured shell using which one can interact with TRex server and get instant results.

The help menu of this application is:

.. code-block:: json

        usage: client_interactive_example [options]

        Run TRex client API demos and scenarios.

        optional arguments:
          -h, --help            show this help message and exit
          -v, --version         show program's version number and exit
          -t HOST, --trex-host HOST
                                Specify the hostname or ip to connect with TRex
                                server.
          -p PORT, --trex-port PORT
                                Select port on which the TRex server listens. Default
                                port is 8090.
          -m SIZE, --maxhist SIZE
                                Specify maximum history size saved at client side.
                                Default size is 100.
          --verbose             Switch ON verbose option at TRex client. Default is:
                                OFF.

**Code Excerpt**

.. literalinclude:: ../examples/client_interactive_example.py
   :language: python
   :emphasize-lines: 0
   :linenos:


End-to-End cycle
----------------

This example (``pkt_generation_for_trex.py``) demonstrates a full cycle of using the API.

.. note:: this module uses the `Scapy <http://www.secdev.org/projects/scapy/doc/usage.html>`_ in order to generate packets to be used as a basis of the traffic injection. It is recommended to *install* this module to best experience the example.

The demo takes the user a full circle: 
    1. Generating packets (using Scapy)
    2. exporting the generated packets into .pcap file named `dns_traffic.pcap`.
    3. Use the :class:`trex_yaml_gen.CTRexYaml` generator to include that pcap file in the yaml object.
    4. Export the YAML object onto a YAML file named `dns_traffic.yaml`
    5. Push the generated files to TRex server.
    6. Run TRex based on the generated (and pushed) files.

**Code Excerpt** [#f1]_ 

.. literalinclude:: ../examples/pkt_generation_for_trex.py
   :language: python
   :lines: 10-
   :emphasize-lines: 32,36,42,46,51,60,63-69,76-80
   :linenos:


.. rubric:: Footnotes

.. [#f1] The marked codelines corresponds with the steps mentioned above.