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_ctx
  • struct 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 pointer
  • conf β€” Security session configuration
  • sess β€” Pointer to Security private session structure

Returns

  • Returns 0 if private session structure have been created successfully.
  • Returns -EINVAL if input parameters are invalid.
  • Returns -ENOTSUP if 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 pointer
  • sess β€” 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 pointer
  • sess β€” Pointer to Security private session structure
  • conf β€” Security session configuration

Returns

  • Returns 0 if private session structure have been updated successfully.
  • Returns -EINVAL if input parameters are invalid.
  • Returns -ENOTSUP if 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 pointer
  • conf β€” MACsec SC configuration params

Returns

  • positive sc_id if SC is created successfully.
  • -EINVAL if input parameters are invalid.
  • -ENOTSUP if device does not support MACsec.
  • -ENOMEM if 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 pointer
  • sc_id β€” MACsec SC ID
  • dir β€” 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 pointer
  • conf β€” MACsec SA configuration params

Returns

  • positive sa_id if SA is created successfully.
  • -EINVAL if input parameters are invalid.
  • -ENOTSUP if device does not support MACsec.
  • -ENOMEM if 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 pointer
  • sa_id β€” MACsec SA ID
  • dir β€” 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 pointer
  • sess β€” Pointer to Security private session structure
  • stats β€” Security stats of the driver

Returns

  • Returns 0 if private session structure have been updated successfully.
  • Returns -EINVAL if 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 pointer
  • sc_id β€” secure channel ID created by rte_security_macsec_sc_create()
  • dir β€” direction of SC
  • stats β€” SC stats of the driver

Returns

  • 0 if success.
  • -EINVAL if sc_id or device is 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 pointer
  • sa_id β€” secure channel ID created by rte_security_macsec_sc_create()
  • dir β€” direction of SA
  • stats β€” SC stats of the driver

Returns

  • 0 if success.
  • -EINVAL if sa_id or device is invalid.
not a typo bestie β€” the docs really do say sa_id is a "secure channel ID created by rte_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 pointer
  • sess β€” Security session structure
  • mb β€” Packet buffer
  • params β€” Metadata

Returns

  • Returns 0 if metadata updated successfully.
  • Returns -ve value 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_capability pointer on success.
  • Returns NULL on 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 pointer
  • port_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

  • 0 if successful.
  • -EINVAL if context NULL or port_id is invalid.
  • -EBUSY if devices are not in stopped state.
  • -ENOTSUP if 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 pointer
  • pkts β€” The address of an array of nb_pkts pointers to rte_mbuf structures which contain the packets.
  • sess β€” The address of an array of nb_pkts pointers to rte_security_session structures 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