DPDK  24.11.0-rc3
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 
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 
109 int
110 rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
111  uint32_t flags, uint32_t snaplen,
112  struct rte_ring *ring,
113  struct rte_mempool *mp,
114  const struct rte_bpf_prm *prm);
115 
133 int
134 rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
135 
160 int
161 rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
162  uint32_t flags,
163  struct rte_ring *ring,
164  struct rte_mempool *mp,
165  void *filter);
166 
192 int
193 rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
194  uint32_t flags, uint32_t snaplen,
195  struct rte_ring *ring,
196  struct rte_mempool *mp,
197  const struct rte_bpf_prm *filter);
198 
199 
218 int
219 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
220  uint32_t flags);
221 
222 
228  RTE_ATOMIC(uint64_t) accepted;
229  RTE_ATOMIC(uint64_t) filtered;
230  RTE_ATOMIC(uint64_t) nombuf;
231  RTE_ATOMIC(uint64_t) ringfull;
233  uint64_t reserved[4];
234 };
235 
246 int
247 rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
248 
249 
250 #ifdef __cplusplus
251 }
252 #endif
253 
254 #endif /* _RTE_PDUMP_H_ */
uint64_t reserved[4]
Definition: rte_pdump.h:233
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_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:230
uint64_t accepted
Definition: rte_pdump.h:228
uint16_t port
uint64_t filtered
Definition: rte_pdump.h:229
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:231
int rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
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_stats(uint16_t port_id, struct rte_pdump_stats *stats)
int rte_pdump_init(void)