doc: add pdump limitation note
[dpdk.git] / doc / guides / sample_app_ug / pdump.rst
1
2 ..  BSD LICENSE
3     Copyright(c) 2016 Intel Corporation. All rights reserved.
4     All rights reserved.
5
6     Redistribution and use in source and binary forms, with or without
7     modification, are permitted provided that the following conditions
8     are met:
9
10     * Redistributions of source code must retain the above copyright
11     notice, this list of conditions and the following disclaimer.
12     * Redistributions in binary form must reproduce the above copyright
13     notice, this list of conditions and the following disclaimer in
14     the documentation and/or other materials provided with the
15     distribution.
16     * Neither the name of Intel Corporation nor the names of its
17     contributors may be used to endorse or promote products derived
18     from this software without specific prior written permission.
19
20     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23     A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24     OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26     LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
32
33 dpdk-pdump Application
34 ======================
35
36 The ``dpdk-pdump`` tool is a Data Plane Development Kit (DPDK) tool that runs as
37 a DPDK secondary process and is capable of enabling packet capture on dpdk ports.
38
39    .. Note::
40       * The ``dpdk-pdump`` tool can only be used in conjunction with a primary
41         application which has the packet capture framework initialized already.
42
43       * The ``dpdk-pdump`` tool depends on libpcap based PMD which is disabled
44         by default in the build configuration files,
45         owing to an external dependency on the libpcap development files
46         which must be installed on the board.
47         Once the libpcap development files are installed, the libpcap based PMD
48         can be enabled by setting CONFIG_RTE_LIBRTE_PMD_PCAP=y and recompiling the DPDK.
49
50
51 Running the Application
52 -----------------------
53
54 The tool has a number of command line options:
55
56 .. code-block:: console
57
58    ./build/app/dpdk-pdump --
59                           --pdump '(port=<port id> | device_id=<pci id or vdev name>),
60                                    (queue=<queue_id>),
61                                    (rx-dev=<iface or pcap file> |
62                                     tx-dev=<iface or pcap file>),
63                                    [ring-size=<ring size>],
64                                    [mbuf-size=<mbuf data size>],
65                                    [total-num-mbufs=<number of mbufs>]'
66                           [--server-socket-path=<server socket dir>]
67                           [--client-socket-path=<client socket dir>]
68
69 The ``--pdump`` command line option is mandatory and it takes various sub arguments which are described in
70 below section.
71
72    .. Note::
73
74       * Parameters inside the parentheses represents mandatory parameters.
75
76       * Parameters inside the square brackets represents optional parameters.
77
78       * Multiple instances of ``--pdump`` can be passed to capture packets on different port and queue combinations.
79
80 The ``--server-socket-path`` command line option is optional. This represents the server socket directory.
81 If no value is passed default values are used i.e. ``/var/run/.dpdk/`` for root users and ``~/.dpdk/``
82 for non root users.
83
84 The ``--client-socket-path`` command line option is optional. This represents the client socket directory.
85 If no value is passed default values are used i.e. ``/var/run/.dpdk/`` for root users and ``~/.dpdk/``
86 for non root users.
87
88
89 The ``--pdump`` parameters
90 ~~~~~~~~~~~~~~~~~~~~~~~~~~
91
92 ``port``:
93 Port id of the eth device on which packets should be captured.
94
95 ``device_id``:
96 PCI address (or) name of the eth device on which packets should be captured.
97
98    .. Note::
99
100       * As of now the ``dpdk-pdump`` tool cannot capture the packets of virtual devices
101         in the primary process due to a bug in the ethdev library. Due to this bug, in a multi process context,
102         when the primary and secondary have different ports set, then the secondary process
103         (here the ``dpdk-pdump`` tool) overwrites the ``rte_eth_devices[]`` entries of the primary process.
104
105 ``queue``:
106 Queue id of the eth device on which packets should be captured. The user can pass a queue value of ``*`` to enable
107 packet capture on all queues of the eth device.
108
109 ``rx-dev``:
110 Can be either a pcap file name or any Linux iface.
111
112 ``tx-dev``:
113 Can be either a pcap file name or any Linux iface.
114
115    .. Note::
116
117       * To receive ingress packets only, ``rx-dev`` should be passed.
118
119       * To receive egress packets only, ``tx-dev`` should be passed.
120
121       * To receive ingress and egress packets separately ``rx-dev`` and ``tx-dev``
122         should both be passed with the different file names or the Linux iface names.
123
124       * To receive ingress and egress packets together, ``rx-dev`` and ``tx-dev``
125         should both be passed with the same file name or the same Linux iface name.
126
127 ``ring-size``:
128 Size of the ring. This value is used internally for ring creation. The ring will be used to enqueue the packets from
129 the primary application to the secondary. This is an optional parameter with default size 16384.
130
131 ``mbuf-size``:
132 Size of the mbuf data. This is used internally for mempool creation. Ideally this value must be same as
133 the primary application's mempool's mbuf data size which is used for packet RX. This is an optional parameter with
134 default size 2176.
135
136 ``total-num-mbufs``:
137 Total number mbufs in mempool. This is used internally for mempool creation. This is an optional parameter with default
138 value 65535.
139
140
141 Example
142 -------
143
144 .. code-block:: console
145
146    $ sudo ./build/app/dpdk-pdump -- --pdump 'port=0,queue=*,rx-dev=/tmp/rx.pcap'