rte_security_driver.h(3)
π rte_security_driver.h π
ok so bestie, this is the rte_security_driver.h page from the DPDK library-functions manual β it's the security driver header, and honestly it's giving "backstage pass to the crypto/eth device ops table" energy. no cap, every single typedef here is a function pointer a PMD is supposed to fill in. let's get into it π
β¨ SYNOPSIS β¨
#include <rte_compat.h>
#include 'rte_security.h'
π«Ά Data Structures
struct rte_security_ctxstruct rte_security_ops
πΈ Macros
#define SECURITY_GET_SESS_PRIV(s)
π¦ Typedefs
typedef int(*security_session_create_t) (void *device, struct
rte_security_session_conf *conf, struct rte_security_session *sess)
typedef int(*security_session_destroy_t) (void *device, struct
rte_security_session *sess)
typedef int(*security_session_update_t) (void *device, struct
rte_security_session *sess, struct rte_security_session_conf *conf)
typedef int(*security_macsec_sc_create_t) (void *device, struct
rte_security_macsec_sc *conf)
typedef int(*security_macsec_sc_destroy_t) (void *device, uint16_t
sc_id, enum rte_security_macsec_direction dir)
typedef int(*security_macsec_sa_create_t) (void *device, struct
rte_security_macsec_sa *conf)
typedef int(*security_macsec_sa_destroy_t) (void *device, uint16_t
sa_id, enum rte_security_macsec_direction dir)
typedef unsigned int(*security_session_get_size) (void *device)
typedef int(*security_session_stats_get_t) (void *device, struct
rte_security_session *sess, struct rte_security_stats *stats)
typedef int(*security_macsec_sc_stats_get_t) (void *device, uint16_t
sc_id, enum rte_security_macsec_direction dir, struct
rte_security_macsec_sc_stats *stats)
typedef int(*security_macsec_sa_stats_get_t) (void *device, uint16_t
sa_id, enum rte_security_macsec_direction dir, struct
rte_security_macsec_sa_stats *stats)
typedef int(*security_set_pkt_metadata_t) (void *device, struct
rte_security_session *sess, struct rte_mbuf *mb, void *params)
typedef const struct rte_security_capability *(*
security_capabilities_get_t) (void *device)
typedef int(*security_rx_inject_configure) (void *device, uint16_t
port_id, bool enable)
typedef uint16_t(*security_inb_pkt_rx_inject) (void *device, struct
rte_mbuf **pkts, struct rte_security_session **sess, uint16_t
nb_pkts)
π Detailed Description π
RTE Security Common Definitions β literally the whole point of this file. π«Ά
Definition in file rte_security_driver.h.
π Macro Definition Documentation π
#define SECURITY_GET_SESS_PRIV( s)
Value:
((void *)(((struct rte_security_session *)s)->driver_priv_data))
Helper macro to get driver private data. that's it, that's the whole macro β it reaches into your session and yoinks out driver_priv_data as a void *. iconic behaviour tbh β¨
Definition at line 66 of file rte_security_driver.h.
β Typedef Documentation β
security_session_create_t
typedef int(* security_session_create_t) (void *device, struct
rte_security_session_conf *conf, struct rte_security_session *sess)
Configure a security session on a device. this is the moment your driver actually sets up the session, bestie π
Parameters
deviceβ Crypto/eth device pointerconfβ Security session configurationsessβ Pointer to Security private session structure
Returns
- Returns
0if private session structure have been created successfully. - Returns
-EINVALif input parameters are invalid. - Returns
-ENOTSUPif crypto device does not support the crypto transform.
Definition at line 83 of file rte_security_driver.h.
security_session_destroy_t
typedef int(* security_session_destroy_t) (void *device, struct
rte_security_session *sess)
Free driver private session data. bye bestie, clean up after yourself π§Ή
Parameters
deviceβ Crypto/eth device pointersessβ Security session structure
Definition at line 93 of file rte_security_driver.h.
security_session_update_t
typedef int(* security_session_update_t) (void *device, struct
rte_security_session *sess, struct rte_security_session_conf *conf)
Update driver private session data. glow-up for your session params π«
Parameters
deviceβ Crypto/eth device pointersessβ Pointer to Security private session structureconfβ Security session configuration
Returns
- Returns
0if private session structure have been updated successfully. - Returns
-EINVALif input parameters are invalid. - Returns
-ENOTSUPif crypto device does not support the crypto transform.
Definition at line 108 of file rte_security_driver.h.
security_macsec_sc_create_t
typedef int(* security_macsec_sc_create_t) (void *device, struct
rte_security_macsec_sc *conf)
Configure a MACsec secure channel (SC) on a device. MACsec era, we're so here for it π₯
Parameters
deviceβ Crypto/eth device pointerconfβ MACsec SC configuration params
Returns
- positive
sc_idif SC is created successfully. -EINVALif input parameters are invalid.-ENOTSUPif device does not support MACsec.-ENOMEMif the SC cannot be created.
Definition at line 124 of file rte_security_driver.h.
security_macsec_sc_destroy_t
typedef int(* security_macsec_sc_destroy_t) (void *device, uint16_t
sc_id, enum rte_security_macsec_direction dir)
Free MACsec secure channel (SC). yeet that SC ποΈ
Parameters
deviceβ Crypto/eth device pointersc_idβ MACsec SC IDdirβ Direction of SC
Definition at line 133 of file rte_security_driver.h.
security_macsec_sa_create_t
typedef int(* security_macsec_sa_create_t) (void *device, struct
rte_security_macsec_sa *conf)
Configure a MACsec security Association (SA) on a device. SA creation, main character energy π
Parameters
deviceβ Crypto/eth device pointerconfβ MACsec SA configuration params
Returns
- positive
sa_idif SA is created successfully. -EINVALif input parameters are invalid.-ENOTSUPif device does not support MACsec.-ENOMEMif the SA cannot be created.
Definition at line 148 of file rte_security_driver.h.
security_macsec_sa_destroy_t
typedef int(* security_macsec_sa_destroy_t) (void *device, uint16_t
sa_id, enum rte_security_macsec_direction dir)
Free MACsec security association (SA). say bye π
Parameters
deviceβ Crypto/eth device pointersa_idβ MACsec SA IDdirβ Direction of SA
Definition at line 157 of file rte_security_driver.h.
security_session_get_size
typedef unsigned int(* security_session_get_size) (void *device)
Get the size of a security session. how much room does this thing need, asking for a friend π
Parameters
deviceβ Crypto/eth device pointer
Returns
- On success returns the size of the session structure for device
- On failure returns
0
Definition at line 169 of file rte_security_driver.h.
security_session_stats_get_t
typedef int(* security_session_stats_get_t) (void *device, struct
rte_security_session *sess, struct rte_security_stats *stats)
Get stats from the PMD. numbers! we love numbers π
Parameters
deviceβ Crypto/eth device pointersessβ Pointer to Security private session structurestatsβ Security stats of the driver
Returns
- Returns
0if private session structure have been updated successfully. - Returns
-EINVALif session parameters are invalid.
Definition at line 182 of file rte_security_driver.h.
security_macsec_sc_stats_get_t
typedef int(* security_macsec_sc_stats_get_t) (void *device, uint16_t
sc_id, enum rte_security_macsec_direction dir, struct
rte_security_macsec_sc_stats *stats)
Get MACsec secure channel stats from the PMD. SC-flavoured stats, slay π
Parameters
deviceβ Crypto/eth device pointersc_idβ secure channel ID created byrte_security_macsec_sc_create()dirβ direction of SCstatsβ SC stats of the driver
Returns
0if success.-EINVALifsc_idordeviceis invalid.
Definition at line 198 of file rte_security_driver.h.
security_macsec_sa_stats_get_t
typedef int(* security_macsec_sa_stats_get_t) (void *device, uint16_t
sa_id, enum rte_security_macsec_direction dir, struct
rte_security_macsec_sa_stats *stats)
Get MACsec SA stats from the PMD. same vibe, SA edition π
Parameters
deviceβ Crypto/eth device pointersa_idβ secure channel ID created byrte_security_macsec_sc_create()dirβ direction of SAstatsβ SC stats of the driver
Returns
0if success.-EINVALifsa_idordeviceis invalid.
Definition at line 214 of file rte_security_driver.h.
security_set_pkt_metadata_t
typedef int(* security_set_pkt_metadata_t) (void *device, struct
rte_security_session *sess, struct rte_mbuf *mb, void *params)
Update the mbuf with provided metadata. little sticker on the packet, iykyk π·οΈ
Parameters
deviceβ Crypto/eth device pointersessβ Security session structurembβ Packet bufferparamsβ Metadata
Returns
- Returns
0if metadata updated successfully. - Returns
-vevalue for errors.
Definition at line 243 of file rte_security_driver.h.
security_capabilities_get_t
typedef const struct rte_security_capability *(*
security_capabilities_get_t) (void *device)
Get security capabilities of the device. what can this thing even do? vibe check π¦
Parameters
deviceβ crypto/eth device pointer
Returns
- Returns
rte_security_capabilitypointer on success. - Returns
NULLon error.
Definition at line 243 of file rte_security_driver.h.
security_rx_inject_configure
typedef int(* security_rx_inject_configure) (void *device, uint16_t
port_id, bool enable)
Configure security device to inject packets to an ethdev port. wiring two devices together, matchmaker behaviour π
Parameters
deviceβ Crypto/eth device pointerport_idβ Port identifier of the ethernet device to which packets need to be injected.enableβ Flag to enable and disable connection between a security device and an ethdev port.
Returns
0if successful.-EINVALif contextNULLorport_idis invalid.-EBUSYif devices are not in stopped state.-ENOTSUPif security device does not support injecting to the ethdev port.
Definition at line 273 of file rte_security_driver.h.
security_inb_pkt_rx_inject
typedef uint16_t(* security_inb_pkt_rx_inject) (void *device, struct
rte_mbuf **pkts, struct rte_security_session **sess, uint16_t
nb_pkts)
Perform security processing of packets and inject the processed packet to ethdev Rx.
Rx inject would behave similarly to ethdev loopback but with the additional security processing. so like loopback, but make it secure β¨
Parameters
deviceβ Crypto/eth device pointerpktsβ The address of an array ofnb_pktspointers torte_mbufstructures which contain the packets.sessβ The address of an array ofnb_pktspointers torte_security_sessionstructures corresponding to each packet.nb_pktsβ The maximum number of packets to process.
Returns
The number of packets successfully injected to ethdev Rx. The return value can be less than the value of the nb_pkts parameter when the PMD internal queues have been filled up.
Definition at line 295 of file rte_security_driver.h.
πΈ Author πΈ
Generated automatically by Doxygen for DPDK from the source code. (yes bestie, a robot wrote the original β we stan a machine-generated queen π€π)
ok that's the whole page fr fr β no options skipped, no typedefs ghosted, every line number and every -EINVAL intact π«Ά this was rte_security_driver.h(3) from the DPDK manual, Version 26.03.0, and it's dated with that same version, soβ¦ go forth and configure your security sessions, periodt π
ππ¦
π¦ where this page comes from
- nixos 26.05: dpdk 26.03
- nixpkgs unstable: dpdk 26.03
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms