summaryrefslogtreecommitdiff
path: root/docs/guides/commands/secondary/spp_pcap.rst
blob: 5b213d32715266a2f6b2a1439f53d15f9f86caea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
..  SPDX-License-Identifier: BSD-3-Clause
    Copyright(c) 2010-2014 Intel Corporation


.. _commands_spp_pcap:

spp_pcap
========

``spp_pcap`` is a kind of SPP secondary process. It it introduced for
providing packet capture features.

Each of ``spp_pcap`` processes is managed with ``pcap`` command. It is for
sending sub commands with specific ID called secondary ID for starting or
stopping packet capture.

Secondary ID is referred as ``--client-id`` which is given as an argument
while launching ``spp_pcap``. It should be unique among all of secondary
processes including ``spp_nfv``, ``spp_vm`` and others.

``pcap`` command takes an secondary ID and one of sub commands. Secondary ID
and sub command should be separated with delimiter ``;``, or failed to a
command error.

.. code-block:: none

    spp > pcap SEC_ID; SUB_CMD

In this example, ``SEC_ID`` is a secondary ID and ``SUB_CMD`` is one of the
following sub commands. Details of each of sub commands are described in the
next sections.

* status
* start
* stop
* exit

``spp_pcap`` supports TAB completion. You can complete all of the name
of commands and its arguments. For instance, you find all of sub commands
by pressing TAB after ``pcap SEC_ID;``.

.. code-block:: none

    spp > pcap 1;  # press TAB key
    exit  start      status        stop

It tries to complete all of possible arguments.

.. code-block:: none

    spp > pcap 1; component st  # press TAB key to show args starting 'st'
    start  status  stop

If you are reached to the end of arguments, no candidate keyword is displayed.
It is a completed statement of ``start`` command, and TAB
completion does not work after ``start`` because it is ready to run.

.. code-block:: none

    spp > pcap 1; start
    Succeeded to start capture

It is also completed secondary IDs of ``spp_pcap`` and it is helpful if you
run several ``spp_pcap`` processes.

.. code-block:: none

    spp > pcap  # press TAB after space following 'pcap'
    1;  3;    # you find two spp_pcap processes of sec ID 1, 3

By the way, it is also a case of no candidate keyword is displayed if your
command statement is wrong. You might be encountered an error if you run the
wrong command. Please take care.

.. code-block:: none

    spp > pcap 1; ste  # no candidate shown for wrong command
    Invalid command "ste".


.. _commands_spp_pcap_status:

status
------

Show the information of worker threads of ``receiver`` and ``writer`` threads
and its resources.

.. code-block:: none

    spp > pcap 1; status
    Basic Information:
      - client-id: 1
      - status: idling
      - lcore_ids:
        - master: 1
        - slaves: [2, 3, 4, 5, 6]
    Components:
      - core:2 receive
        - rx: phy:0
      - core:3 write
        - filename:
      - core:4 write
        - filename:
      - core:5 write
        - filename:
      - core:6 write
        - filename:

``client-id`` is a secondary ID of the process and ``status`` shows
running status.

Each of lcore has a role of ``receive`` or ``write``.
``receiver`` has capture port as input and ``write`` has a capture file
as output, but the ``filename`` is empty while ``idling`` status
because capturing is not started yet.

If you start capturing, you can find each of ``writer`` threads has a
capture file. After capturing is stopped, ``filename`` is returned to
be empty again.

.. code-block:: none

    spp > pcap 2; status
      - client-id: 2
      - status: running
      - core:2 receive
        - rx: phy:0
      - core:3 write
        - filename: /tmp/spp_pcap.20190214161550.phy0.1.1.pcap.lz4
      - core:4 write
        - filename: /tmp/spp_pcap.20190214161550.phy0.2.1.pcap.lz4
      - core:5 write
        - filename: /tmp/spp_pcap.20190214161550.phy0.3.1.pcap.lz4
      - core:6 write
        - filename: /tmp/spp_pcap.20190214161550.phy0.4.1.pcap.lz4


.. _commands_spp_pcap_start:

start
-----

Start packet capture.

.. code-block:: none

    # start capture
    spp > pcap SEC_ID; start

Here is a example of starting capture.

.. code-block:: none

    # start capture
    spp > pcap 1; start
    Start packet capture.


.. _commands_spp_pcap_stop:

stop
----

Stop packet capture.

.. code-block:: none

   # stop capture
   spp > pcap SEC_ID; stop

Here is a example of stopping capture.

.. code-block:: none

    # stop capture
    spp > pcap 2; stop
    Start packet capture.


.. _commands_spp_pcap_exit:

exit
----

Terminate the ``spp_pcap``.

.. code-block:: none

    spp > pcap 1; exit