DPDK  23.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_compat.h>
17 #include <rte_bpf.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #define RTE_PDUMP_ALL_QUEUES UINT16_MAX
24 
25 enum {
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),
30 
31  RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
32 };
33 
42 int
43 rte_pdump_init(void);
44 
53 int
54 rte_pdump_uninit(void);
55 
79 int
80 rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
81  struct rte_ring *ring,
82  struct rte_mempool *mp,
83  void *filter);
84 
112 __rte_experimental
113 int
114 rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
115  uint32_t flags, uint32_t snaplen,
116  struct rte_ring *ring,
117  struct rte_mempool *mp,
118  const struct rte_bpf_prm *prm);
119 
137 int
138 rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
139 
164 int
165 rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
166  uint32_t flags,
167  struct rte_ring *ring,
168  struct rte_mempool *mp,
169  void *filter);
170 
199 __rte_experimental
200 int
201 rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
202  uint32_t flags, uint32_t snaplen,
203  struct rte_ring *ring,
204  struct rte_mempool *mp,
205  const struct rte_bpf_prm *filter);
206 
207 
226 int
227 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
228  uint32_t flags);
229 
230 
236  uint64_t accepted;
237  uint64_t filtered;
238  uint64_t nombuf;
239  uint64_t ringfull;
241  uint64_t reserved[4];
242 };
243 
257 __rte_experimental
258 int
259 rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
260 
261 
262 #ifdef __cplusplus
263 }
264 #endif
265 
266 #endif /* _RTE_PDUMP_H_ */
uint64_t reserved[4]
Definition: rte_pdump.h:241
__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:238
uint64_t accepted
Definition: rte_pdump.h:236
uint64_t filtered
Definition: rte_pdump.h:237
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:239
__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)