rte_ipsec.h(3)
π rte_ipsec.h β Library Functions Manual π
okay bestie, so this is the manual page for rte_ipsec.h, like from the DPDK family, and I'm gonna walk you through every single thing in it, no skipping, no gatekeeping, periodt. π«Ά
β¨ NAME β¨
rte_ipsec.h β that's the whole name, simple, iconic, no notes. π
πΈ SYNOPSIS πΈ
First things first, you gotta pull in the headers, like:
#include <rte_ipsec_sa.h>
#include <rte_mbuf.h>
#include <rte_ipsec_group.h>
π¦ Data Structures
okay so these are the structs living in here:
struct rte_ipsec_statestruct rte_ipsec_sa_pkt_funcstruct rte_ipsec_session
π Functions
and here's every function, laid out exactly how the page has them:
int rte_ipsec_session_prepare (struct rte_ipsec_session *ss)static uint16_t rte_ipsec_pkt_crypto_prepare (const struct rte_ipsec_session *ss, struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num)static __rte_experimental uint16_t rte_ipsec_pkt_crypto_prepare_stateless (const struct rte_ipsec_session *ss, struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num, struct rte_ipsec_state *state)static __rte_experimental uint16_t rte_ipsec_pkt_cpu_prepare_stateless (const struct rte_ipsec_session *ss, struct rte_mbuf *mb[], uint16_t num, struct rte_ipsec_state *state)static uint16_t rte_ipsec_pkt_process (const struct rte_ipsec_session *ss, struct rte_mbuf *mb[], uint16_t num)int rte_ipsec_telemetry_sa_add (const struct rte_ipsec_sa *sa)void rte_ipsec_telemetry_sa_del (const struct rte_ipsec_sa *sa)
π Detailed Description π
So, RTE IPsec support. That's the vibe.
librte_ipsec hands you a whole framework for doing data-path IPsec protocol processing (ESP/AH). That's the main character energy right there. π
Definition in file rte_ipsec.h.
π₯ Function Documentation π₯
int rte_ipsec_session_prepare (struct rte_ipsec_session * ss)
This one checks that inside the given rte_ipsec_session, the crypto/security fields are actually filled in correctly, and then it sets up the function pointers based on those values. Important though β it expects that the caller has already filled in every field correctly except the IPsec processing function pointers (pkt_func). So don't come to it half-done, bestie, it's not gonna do that part for you. π
Parameters
ssβ Pointer to therte_ipsec_sessionobject.
Returns
- Zero if operation completed successfully. β¨
-EINVALif the parameters are invalid. π
uint16_t rte_ipsec_pkt_crypto_prepare (const struct rte_ipsec_session * ss, struct rte_mbuf * mb[], struct rte_crypto_op * cop[], uint16_t num)
[inline], [static]
okay so for the input mbufs and a given IPsec session, this prepares crypto ops that you can enqueue into the cryptodev associated with that session. It expects that for each input packet:
l2_len,l3_lenare setup correctly.
Note that erroneous mbufs are not freed by the function β instead they get placed beyond the last valid mbuf in the mb array. It is a user responsibility to handle them further. So yeah, they're just sitting there past the valid ones, and that's on you. π
Parameters
ssβ Pointer to therte_ipsec_sessionobject the packets belong to.mbβ The address of an array of num pointers torte_mbufstructures which contain the input packets.copβ The address of an array of num pointers to the outputrte_crypto_opstructures.numβ The maximum number of packets to process.
Returns
Number of successfully processed packets, with error code set in rte_errno.
Definition at line 138 of file rte_ipsec.h.
__rte_experimental uint16_t rte_ipsec_pkt_crypto_prepare_stateless (const struct rte_ipsec_session * ss, struct rte_mbuf * mb[], struct rte_crypto_op * cop[], uint16_t num, struct rte_ipsec_state * state)
[inline], [static]
Same as rte_ipsec_pkt_crypto_prepare, but the processing is done based on the IPsec state provided by the state parameter. And listen β internal IPsec state won't be updated when this API is called. Stateless means stateless, bestie. π
For input mbufs and given IPsec session prepare crypto ops that can be enqueued into the cryptodev associated with given session. expects that for each input packet:
l2_len,l3_lenare setup correctly.
Note that erroneous mbufs are not freed by the function, but are placed beyond last valid mbuf in the mb array. It is a user responsibility to handle them further.
Parameters
ssβ Pointer to therte_ipsec_sessionobject the packets belong to.mbβ The address of an array of num pointers torte_mbufstructures which contain the input packets.copβ The address of an array of num pointers to the outputrte_crypto_opstructures.numβ The maximum number of packets to process.stateβ The IPsec state to be used for processing current batch of packets.
Returns
Number of successfully processed packets, with error code set in rte_errno.
Definition at line 180 of file rte_ipsec.h.
__rte_experimental uint16_t rte_ipsec_pkt_cpu_prepare_stateless (const struct rte_ipsec_session * ss, struct rte_mbuf * mb[], uint16_t num, struct rte_ipsec_state * state)
[inline], [static]
Same as rte_ipsec_pkt_crypto_prepare_stateless, but this time the processing happens in synchronous mode. Slay. β¨
Parameters
ssβ Pointer to therte_ipsec_sessionobject the packets belong to.mbβ The address of an array of num pointers torte_mbufstructures which contain the input packets.numβ The maximum number of packets to process.stateβ The IPsec state to be used for processing current batch of packets.
Returns
Number of successfully processed packets, with error code set in rte_errno.
Definition at line 205 of file rte_ipsec.h.
uint16_t rte_ipsec_pkt_process (const struct rte_ipsec_session * ss, struct rte_mbuf * mb[], uint16_t num)
[inline], [static]
This is the closer π¬ β it finalises processing of packets after crypto-dev finished with them, or it processes packets that are subjects to inline IPsec offload.
Expects that for each input packet:
l2_len,l3_lenare setup correctly.
Output mbufs will be:
- inbound β decrypted & authenticated, ESP(AH) related headers removed,
l2_lenandl3_lenfields are updated. - outbound β appropriate mbuf fields (
ol_flags,tx_offloads, etc.) properly setup, if necessary β IP headers updated, ESP(AH) fields added.
Note that erroneous mbufs are not freed by the function, but are placed beyond last valid mbuf in the mb array. It is a user responsibility to handle them further. π«Ά
Parameters
ssβ Pointer to therte_ipsec_sessionobject the packets belong to.mbβ The address of an array of num pointers torte_mbufstructures which contain the input packets.numβ The maximum number of packets to process.
Returns
Number of successfully processed packets, with error code set in rte_errno.
Definition at line 235 of file rte_ipsec.h.
int rte_ipsec_telemetry_sa_add (const struct rte_ipsec_sa * sa)
Turns on per-SA telemetry for a specific SA. Obsessed. π
Heads up bestie: note that this function is not thread safe. π
Parameters
saβ Pointer to therte_ipsec_saobject that will have telemetry enabled.
Returns
0 on success, negative value otherwise.
void rte_ipsec_telemetry_sa_del (const struct rte_ipsec_sa * sa)
Turns off per-SA telemetry for a specific SA. The reverse of a slay.
Same warning, no cap: note that this function is not thread safe. π
Parameters
saβ Pointer to therte_ipsec_saobject that will have telemetry disabled.
π Author π
Generated automatically by Doxygen for DPDK from the source code. (Not a human, just a robot doing its little robot thing. π€π«Ά)
and that's the whole page, bestie!! DPDK Version 25.11.3, rte_ipsec.h(3), bye bestie, go encrypt something responsibly πβ¨ππ¦πΈπ
π¦ 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