DPDK  22.03.0
rte_pdump.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2016 Intel Corporation
3  */
4 
5 #ifndef _RTE_PDUMP_H_
6 #define _RTE_PDUMP_H_
7 
15 #include <stdint.h>
16 #include <rte_bpf.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #define RTE_PDUMP_ALL_QUEUES UINT16_MAX
23 
24 enum {
25  RTE_PDUMP_FLAG_RX = 1, /* receive direction */
26  RTE_PDUMP_FLAG_TX = 2, /* transmit direction */
27  /* both receive and transmit directions */
28  RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX),
29 
30  RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
31 };
32 
41 int
42 rte_pdump_init(void);
43 
52 int
53 rte_pdump_uninit(void);
54 
78 int
79 rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
80  struct rte_ring *ring,
81  struct rte_mempool *mp,
82  void *filter);
83 
111 __rte_experimental
112 int
113 rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
114  uint32_t flags, uint32_t snaplen,
115  struct rte_ring *ring,
116  struct rte_mempool *mp,
117  const struct rte_bpf_prm *prm);
118 
136 int
137 rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
138 
163 int
164 rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
165  uint32_t flags,
166  struct rte_ring *ring,
167  struct rte_mempool *mp,
168  void *filter);
169 
198 __rte_experimental
199 int
200 rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
201  uint32_t flags, uint32_t snaplen,
202  struct rte_ring *ring,
203  struct rte_mempool *mp,
204  const struct rte_bpf_prm *filter);
205 
206 
225 int
226 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
227  uint32_t flags);
228 
229 
235  uint64_t accepted;
236  uint64_t filtered;
237  uint64_t nombuf;
238  uint64_t ringfull;
240  uint64_t reserved[4];
241 };
242 
256 __rte_experimental
257 int
258 rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
259 
260 
261 #ifdef __cplusplus
262 }
263 #endif
264 
265 #endif /* _RTE_PDUMP_H_ */
uint64_t reserved[4]
Definition: rte_pdump.h:240
__rte_experimental int rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue, uint32_t flags, uint32_t snaplen, struct rte_ring *ring, struct rte_mempool *mp, const struct rte_bpf_prm *prm)
int rte_pdump_uninit(void)
int rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter)
int rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue, uint32_t flags)
uint64_t nombuf
Definition: rte_pdump.h:237
uint64_t accepted
Definition: rte_pdump.h:235
uint64_t filtered
Definition: rte_pdump.h:236
int rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter)
uint64_t ringfull
Definition: rte_pdump.h:238
__rte_experimental int rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue, uint32_t flags, uint32_t snaplen, struct rte_ring *ring, struct rte_mempool *mp, const struct rte_bpf_prm *filter)
int rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
int rte_pdump_init(void)
__rte_experimental int rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats)