1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2016 Intel Corporation
12 * packet dump library to provide packet capturing support on dpdk.
16 #include <rte_mempool.h>
23 #define RTE_PDUMP_ALL_QUEUES UINT16_MAX
26 RTE_PDUMP_FLAG_RX = 1, /* receive direction */
27 RTE_PDUMP_FLAG_TX = 2, /* transmit direction */
28 /* both receive and transmit directions */
29 RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX)
33 * Initialize packet capturing handling
35 * Register the IPC action for communication with target (primary) process.
38 * 0 on success, -1 on error
44 * Un initialize packet capturing handling
46 * Unregister the IPC action for communication with target (primary) process.
49 * 0 on success, -1 on error
52 rte_pdump_uninit(void);
55 * Enables packet capturing on given port and queue.
58 * port on which packet capturing should be enabled.
60 * queue of a given port on which packet capturing should be enabled.
61 * users should pass on value UINT16_MAX to enable packet capturing on all
62 * queues of a given port.
64 * flags specifies RTE_PDUMP_FLAG_RX/RTE_PDUMP_FLAG_TX/RTE_PDUMP_FLAG_RXTX
65 * on which packet capturing should be enabled for a given port and queue.
67 * ring on which captured packets will be enqueued for user.
69 * mempool on to which original packets will be mirrored or duplicated.
71 * place holder for packet filtering.
74 * 0 on success, -1 on error, rte_errno is set accordingly.
78 rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
79 struct rte_ring *ring,
80 struct rte_mempool *mp,
84 * Disables packet capturing on given port and queue.
87 * port on which packet capturing should be disabled.
89 * queue of a given port on which packet capturing should be disabled.
90 * users should pass on value UINT16_MAX to disable packet capturing on all
91 * queues of a given port.
93 * flags specifies RTE_PDUMP_FLAG_RX/RTE_PDUMP_FLAG_TX/RTE_PDUMP_FLAG_RXTX
94 * on which packet capturing should be enabled for a given port and queue.
97 * 0 on success, -1 on error, rte_errno is set accordingly.
101 rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
104 * Enables packet capturing on given device id and queue.
105 * device_id can be name or pci address of device.
108 * device id on which packet capturing should be enabled.
110 * queue of a given device id on which packet capturing should be enabled.
111 * users should pass on value UINT16_MAX to enable packet capturing on all
112 * queues of a given device id.
114 * flags specifies RTE_PDUMP_FLAG_RX/RTE_PDUMP_FLAG_TX/RTE_PDUMP_FLAG_RXTX
115 * on which packet capturing should be enabled for a given port and queue.
117 * ring on which captured packets will be enqueued for user.
119 * mempool on to which original packets will be mirrored or duplicated.
121 * place holder for packet filtering.
124 * 0 on success, -1 on error, rte_errno is set accordingly.
128 rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
130 struct rte_ring *ring,
131 struct rte_mempool *mp,
135 * Disables packet capturing on given device_id and queue.
136 * device_id can be name or pci address of device.
139 * pci address or name of the device on which packet capturing
140 * should be disabled.
142 * queue of a given device on which packet capturing should be disabled.
143 * users should pass on value UINT16_MAX to disable packet capturing on all
144 * queues of a given device id.
146 * flags specifies RTE_PDUMP_FLAG_RX/RTE_PDUMP_FLAG_TX/RTE_PDUMP_FLAG_RXTX
147 * on which packet capturing should be enabled for a given port and queue.
150 * 0 on success, -1 on error, rte_errno is set accordingly.
153 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
160 #endif /* _RTE_PDUMP_H_ */