Imported Upstream version 16.07-rc1
[deb_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`` application is a Data Plane Development Kit (DPDK) application that runs as a DPDK secondary process and
37 is capable of enabling packet capture on dpdk ports.
38
39
40 Running the Application
41 -----------------------
42
43 The application has a ``--pdump`` command line option with various sub arguments:
44
45 .. code-block:: console
46
47    ./build/app/dpdk_pdump --
48                           --pdump '(port=<port id> | device_id=<pci id or vdev name>),
49                                    (queue=<queue_id>),
50                                    (rx-dev=<iface or pcap file> |
51                                     tx-dev=<iface or pcap file>),
52                                    [ring-size=<ring size>],
53                                    [mbuf-size=<mbuf data size>],
54                                    [total-num-mbufs=<number of mbufs>]'
55
56 Note:
57
58 * Parameters inside the parentheses represents mandatory parameters.
59
60 * Parameters inside the square brackets represents optional parameters.
61
62 Multiple instances of ``--pdump`` can be passed to capture packets on different port and queue combinations.
63
64
65 Parameters
66 ~~~~~~~~~~
67
68 ``port``:
69 Port id of the eth device on which packets should be captured.
70
71 ``device_id``:
72 PCI address (or) name of the eth device on which packets should be captured.
73
74    .. Note::
75
76       * As of now the ``dpdk_pdump`` tool cannot capture the packets of virtual devices
77         in the primary process due to a bug in the ethdev library. Due to this bug, in a multi process context,
78         when the primary and secondary have different ports set, then the secondary process
79         (here the ``dpdk_pdump`` tool) overwrites the ``rte_eth_devices[]`` entries of the primary process.
80
81 ``queue``:
82 Queue id of the eth device on which packets should be captured. The user can pass a queue value of ``*`` to enable
83 packet capture on all queues of the eth device.
84
85 ``rx-dev``:
86 Can be either a pcap file name or any Linux iface.
87
88 ``tx-dev``:
89 Can be either a pcap file name or any Linux iface.
90
91    .. Note::
92
93       * To receive ingress packets only, ``rx-dev`` should be passed.
94
95       * To receive egress packets only, ``tx-dev`` should be passed.
96
97       * To receive ingress and egress packets separately ``rx-dev`` and ``tx-dev``
98         should both be passed with the different file names or the Linux iface names.
99
100       * To receive ingress and egress packets separately ``rx-dev`` and ``tx-dev``
101         should both be passed with the same file names or the the Linux iface names.
102
103 ``ring-size``:
104 Size of the ring. This value is used internally for ring creation. The ring will be used to enqueue the packets from
105 the primary application to the secondary. This is an optional parameter with default size 16384.
106
107 ``mbuf-size``:
108 Size of the mbuf data. This is used internally for mempool creation. Ideally this value must be same as
109 the primary application's mempool's mbuf data size which is used for packet RX. This is an optional parameter with
110 default size 2176.
111
112 ``total-num-mbufs``:
113 Total number mbufs in mempool. This is used internally for mempool creation. This is an optional parameter with default
114 value 65535.
115
116
117 Example
118 -------
119
120 .. code-block:: console
121
122    $ sudo ./build/app/dpdk_pdump -- --pdump 'port=0,queue=*,rx-dev=/tmp/rx.pcap'