rte_security_driver.h(3)
π rte_security_driver.h β bestie's guide to the RTE Security driver plumbing π
okay so this is the manual page for rte_security_driver.h, a library header in DPDK. it's giving "the common definitions that make the security layer go" and honestly? we're obsessed. it's section 3 of the library functions manual, so pull up a chair, grab a strawberry π, and let's get into it.
β¨ NAME β¨
rte_security_driver.h β the header that holds the shared RTE security driver definitions π
β¨ 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)
seriously, look at that list. π that's a whole lotta function-pointer realness and every single one of them is getting its own moment below, don't you worry.
β¨ Detailed Description β¨
RTE Security Common Definitions π
Definition in file rte_security_driver.h.
translation: this is where the shared security definitions live. the drivers come here, they get their pointers, they vibe. π¦
β¨ 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 π«
Definition at line 66 of file rte_security_driver.h.
β¨ Typedef Documentation β¨
π§ 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 the session gets born β¨
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.
π§ typedef int(* security_session_destroy_t) (void *device, struct rte_security_session *sess)
free driver private session data. it's giving closure, but for memory π
Parameters
deviceβ Crypto/eth device pointersessβ Security session structure
Definition at line 93 of file rte_security_driver.h.
π§ 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 an existing session, no cap. π
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.
π§ typedef int(* security_macsec_sc_create_t) (void *device, struct rte_security_macsec_sc *conf)
configure a MACsec secure channel (SC) on a device. secure channel origin story fr fr π₯
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.
π§ typedef int(* security_macsec_sc_destroy_t) (void *device, uint16_t sc_id, enum rte_security_macsec_direction dir)
free MACsec secure channel (SC). say bye bestie π«Ά
Parameters
deviceβ Crypto/eth device pointersc_idβ MACsec SC IDdirβ Direction of SC
Definition at line 133 of file rte_security_driver.h.
π§ typedef int(* security_macsec_sa_create_t) (void *device, struct rte_security_macsec_sa *conf)
configure a MACsec security Association (SA) on a device. yes, SA and SC are different things and yes, we're keeping them both π
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.
π§ typedef int(* security_macsec_sa_destroy_t) (void *device, uint16_t sa_id, enum rte_security_macsec_direction dir)
free MACsec security association (SA). the SA is entering its retirement era πΈ
Parameters
deviceβ Crypto/eth device pointersa_idβ MACsec SA IDdirβ Direction of SA
Definition at line 157 of file rte_security_driver.h.
π§ typedef unsigned int(* security_session_get_size) (void *device)
get the size of a security session π
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.
π§ 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.
π§ 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 β¨
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.
π§ 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 π
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.
not a typo bestie β the docs really do saysa_idis a "secure channel ID created byrte_security_macsec_sc_create()". we report, we don't edit. π
Definition at line 214 of file rte_security_driver.h.
π§ 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 mbuf makeover moment π
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.
π§ typedef const struct rte_security_capability *(* security_capabilities_get_t) (void *device)
get security capabilities of the device. main character energy: what can you even do π
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.
π§ typedef int(* security_rx_inject_configure) (void *device, uint16_t port_id, bool enable)
configure security device to inject packets to an ethdev port π
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.
π§ 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. the full glow-up pipeline β¨
Rx inject would behave similarly to ethdev loopback but with the additional security processing.
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. π€ (the robot did the typing, we did the vibes)
and that's the whole page bestie, no notes, 10/10, ate and left no crumbs. π this was DPDK, Version 25.11.3, and rte_security_driver.h(3) β go forth and configure those security sessions responsibly, mwah πβ¨π
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms