rte_bpf_ethdev.h(3)

πŸ“¦ version 26.03, in nixos 26.05, nixpkgs unstable

🌸 NAME 🌸

okay bestie, this is rte_bpf_ethdev.h(3) from the Library Functions Manual β€” the header for the API that installs a BPF filter as RX/TX callbacks for eth devices. it's giving low-level filter energy ✨

πŸŽ€ SYNOPSIS πŸŽ€

#include <rte_bpf.h>

Enumerations

enum {  }

Functions

void rte_bpf_eth_rx_unload (uint16_t port, uint16_t queue)
void rte_bpf_eth_tx_unload (uint16_t port, uint16_t queue)
int rte_bpf_eth_rx_elf_load (uint16_t port, uint16_t queue, const struct
    rte_bpf_prm *prm, const char *fname, const char *sname, uint32_t
    flags)
int rte_bpf_eth_tx_elf_load (uint16_t port, uint16_t queue, const struct
    rte_bpf_prm *prm, const char *fname, const char *sname, uint32_t
    flags)

🫢 Detailed Description 🫢

okay so this is the API to install a BPF filter as RX/TX callbacks for eth devices. But bestie, note that right now:

  • it is not MT safe β€” i.e. it is not allowed to do load/unload for the same port/queue from different threads in parallel. 😭
  • though it allows to do load/unload at runtime (while RX/TX is ongoing on the given port/queue). ✨
  • it allows only one BPF program per port/queue, i.e. a new load will replace the previously loaded BPF program for that port/queue. πŸ‘‘

Filter behaviour, bestie: if the BPF program returns zero value for a given packet, then it will be dropped inside the callback and no further processing on RX β€” it will be dropped inside the callback and no further processing for that packet will happen. On TX, the packet will remain unsent, and it is the responsibility of the user to handle such situation (drop, try to send again, etc.). πŸ’€

Definition in file rte_bpf_ethdev.h.

πŸ¦‹ Enumeration Type Documentation πŸ¦‹

anonymous enum

Enumerator

  • RTE_BPF_ETH_F_JIT β€” use compiled into native ISA code. πŸ”₯

Definition at line 33 of file rte_bpf_ethdev.h.

πŸ’… Function Documentation πŸ’…

rte_bpf_eth_rx_unload

void rte_bpf_eth_rx_unload (uint16_t port, uint16_t queue)

Unload a previously loaded BPF program (if any) from the given RX port/queue and remove the appropriate RX port/queue callback. 🫢

Parameters

  • port β€” the identifier of the ethernet port.
  • queue β€” the identifier of the RX queue on the given port.

rte_bpf_eth_tx_unload

void rte_bpf_eth_tx_unload (uint16_t port, uint16_t queue)

Unload a previously loaded BPF program (if any) from the given TX port/queue and remove the appropriate TX port/queue callback. 🫢

Parameters

  • port β€” the identifier of the ethernet port.
  • queue β€” the identifier of the TX queue on the given port.

rte_bpf_eth_rx_elf_load

int rte_bpf_eth_rx_elf_load (uint16_t port, uint16_t queue, const struct
    rte_bpf_prm * prm, const char * fname, const char * sname, uint32_t
    flags)

Load a BPF program from the ELF file and install a callback to execute it on the given RX port/queue. ✨

Parameters

  • port β€” the identifier of the ethernet port.
  • queue β€” the identifier of the RX queue on the given port.
  • fname β€” pathname for a ELF file.
  • sname β€” name of the executable section within the file to load.
  • prm β€” parameters used to create and initialise the BPF execution context.
  • flags β€” flags that define expected behavior of the loaded filter (i.e. jited/non-jited version to use).

Returns β€” zero on successful completion or negative error code otherwise. πŸ’–

rte_bpf_eth_tx_elf_load

int rte_bpf_eth_tx_elf_load (uint16_t port, uint16_t queue, const struct
    rte_bpf_prm * prm, const char * fname, const char * sname, uint32_t
    flags)

Load a BPF program from the ELF file and install a callback to execute it on the given TX port/queue. ✨

Parameters

  • port β€” the identifier of the ethernet port.
  • queue β€” the identifier of the TX queue on the given port.
  • fname β€” pathname for a ELF file.
  • sname β€” name of the executable section within the file to load.
  • prm β€” parameters used to create and initialise the BPF execution context.
  • flags β€” flags that define expected behavior of the loaded filter (i.e. jited/non-jited version to use).

Returns β€” zero on successful completion or negative error code otherwise. πŸ’–

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for DPDK from the source code. (yes bestie, the robots wrote this one πŸ€–)


mwah πŸ’‹ β€” signing off with DPDK Version 26.03.0 and page rte_bpf_ethdev.h(3). periodt. 🌈

πŸ“¦ where this page comes from