rte_pdump.h(3)

πŸ’– rte_pdump.h β€” Library Functions Manual πŸ’–

okay bestie, pull up a chair, we're doing the RTE pdump header today and honestly? it's giving main character energy. this is rte_pdump.h(3), no cap. πŸ¦‹


✨ NAME ✨

rte_pdump.h β€” literally just the header file, that's the whole name, we keep it simple here πŸ’…


🌸 SYNOPSIS 🌸

#include <stdint.h>
#include <rte_bpf.h>

πŸŽ€ Data Structures

  • struct rte_pdump_stats

πŸ’œ Functions

int rte_pdump_init (void)
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_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_disable (uint16_t port, uint16_t queue, uint32_t flags)
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)
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_by_deviceid (char *device_id, uint16_t queue,
    uint32_t flags)
int rte_pdump_stats (uint16_t port_id, struct rte_pdump_stats *stats)

🌈 Detailed Description 🌈

okay so. RTE pdump. it's the packet dump library and its whole job is providing packet capturing support on dpdk. that's it. that's the vibe. πŸ‘‘

Definition in file rte_pdump.h.

πŸ‘‘ Function Documentation πŸ‘‘

⭐ int rte_pdump_init (void )

Initialize packet capturing handling, bestie. ✨

what it actually does: registers the IPC action so you can communicate with the target (primary) process. iykyk. 🫢

Returns

  • 0 on success, -1 on error

⭐ int rte_pdump_uninit (void )

Un initialize packet capturing handling.

the way that it unregisters the IPC action used for communication with the target (primary) process. cleanup era πŸ’…

Returns

  • 0 on success, -1 on error

πŸ”₯ int rte_pdump_enable (uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring * ring, struct rte_mempool * mp, void * filter)

Enables packet capturing on given port and queue. πŸ”₯

Parameters

  • port β€” the port you want packet capturing enabled on.
  • queue β€” the queue of a given port where packet capturing should be enabled. bestie you should pass the value UINT16_MAX if you wanna enable packet capturing on all the queues of a given port.
  • flags β€” flags specifies RTE_PDUMP_FLAG_RX/RTE_PDUMP_FLAG_TX/RTE_PDUMP_FLAG_RXTX, i.e. which direction packet capturing should be enabled for on a given port and queue.
  • ring β€” the ring where captured packets get enqueued for the user.
  • mp β€” the mempool onto which original packets will be mirrored or duplicated.
  • filter β€” Unused, should be NULL. don't be quirky with it 😭

Returns

  • 0 on success, -1 on error, and rte_errno is set accordingly.

πŸ”₯ 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)

Enables packet capturing on given port and queue with filtering. the glow-up version, we stan 🧚

Parameters

  • port_id β€” The Ethernet port on which packet capturing should be enabled.
  • queue β€” The queue on the Ethernet port which packet capturing should be enabled. Pass UINT16_MAX to enable packet capturing on all queues of a given port.
  • flags β€” Pdump library flags that specify direction and packet format.
  • snaplen β€” The upper limit on bytes to copy. Passing UINT32_MAX means capture all the possible data.
  • ring β€” The ring on which captured packets will be enqueued for user.
  • mp β€” The mempool on to which original packets will be mirrored or duplicated.
  • prm β€” Use BPF program to run to filter packes (can be NULL)

Returns

  • 0 on success, -1 on error, and rte_errno is set accordingly.

πŸ’€ int rte_pdump_disable (uint16_t port, uint16_t queue, uint32_t flags)

Disables packet capturing on given port and queue. the sad part of the story πŸ’€

Parameters

  • port β€” port on which packet capturing should be disabled.
  • queue β€” queue of a given port on which packet capturing should be disabled. users should pass on value UINT16_MAX to disable packet capturing on all queues of a given port.
  • flags β€” flags specifies RTE_PDUMP_FLAG_RX/RTE_PDUMP_FLAG_TX/RTE_PDUMP_FLAG_RXTX on which packet capturing should be enabled for a given port and queue.

Returns

  • 0 on success, -1 on error, and rte_errno is set accordingly.

πŸ¦‹ 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)

Enables packet capturing on given device id and queue. heads up: device_id can be a name or a pci address of the device. versatile icon πŸ’…

Parameters

  • device_id β€” device id on which packet capturing should be enabled.
  • queue β€” queue of a given device id on which packet capturing should be enabled. users should pass on value UINT16_MAX to enable packet capturing on all queues of a given device id.
  • flags β€” flags specifies RTE_PDUMP_FLAG_RX/RTE_PDUMP_FLAG_TX/RTE_PDUMP_FLAG_RXTX on which packet capturing should be enabled for a given port and queue.
  • ring β€” ring on which captured packets will be enqueued for user.
  • mp β€” mempool on to which original packets will be mirrored or duplicated.
  • filter β€” unused, should be NULL

Returns

  • 0 on success, -1 on error, and rte_errno is set accordingly.

πŸ¦‹ 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)

Enables packet capturing on given device id and queue with filtering. and reminder bestie: device_id can be a name or pci address of device. ✨

Parameters

  • device_id β€” device id on which packet capturing should be enabled.
  • queue β€” The queue on the Ethernet port which packet capturing should be enabled. Pass UINT16_MAX to enable packet capturing on all queues of a given port.
  • flags β€” Pdump library flags that specify direction and packet format.
  • snaplen β€” The upper limit on bytes to copy. Passing UINT32_MAX means capture all the possible data.
  • ring β€” The ring on which captured packets will be enqueued for user.
  • mp β€” The mempool on to which original packets will be mirrored or duplicated.
  • filter β€” Use BPF program to run to filter packes (can be NULL)

Returns

  • 0 on success, -1 on error, and rte_errno is set accordingly.

πŸ“ int rte_pdump_disable_by_deviceid (char * device_id, uint16_t queue, uint32_t flags)

Disables packet capturing on given device_id and queue. and yeah, device_id can be a name or pci address of device. πŸ“

Parameters

  • device_id β€” pci address or name of the device on which packet capturing should be disabled.
  • queue β€” queue of a given device on which packet capturing should be disabled. users should pass on value UINT16_MAX to disable packet capturing on all queues of a given device id.
  • flags β€” flags specifies RTE_PDUMP_FLAG_RX/RTE_PDUMP_FLAG_TX/RTE_PDUMP_FLAG_RXTX on which packet capturing should be enabled for a given port and queue.

Returns

  • 0 on success, -1 on error, and rte_errno is set accordingly.

πŸ“Š int rte_pdump_stats (uint16_t port_id, struct rte_pdump_stats * stats)

Retrieve the packet capture statistics for a queue. numbers era, we love data πŸ“Š

Parameters

  • port_id β€” The port identifier of the Ethernet device.
  • stats β€” A pointer to structure of type rte_pdump_stats to be filled in.

Returns

  • Zero if successful. -1 on error and rte_errno is set.

🌸 Author 🌸

Generated automatically by Doxygen for DPDK from the source code. (not a human author, just a robot doing its lil thing πŸ€–βœ¨)


aaaand that's the whole page bestie, you ate that 🫢 go capture some packets responsibly β€” mwah πŸ’–

DPDK, Version 25.11.3 β€” rte_pdump.h(3), signing off πŸ’…πŸŒΈ
πŸ“¦ where this page comes from