6#ifndef _RTE_SECURITY_H_
7#define _RTE_SECURITY_H_
17#include <rte_compat.h>
56#define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_DST_ADDR 0x1
57#define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_SRC_DST_ADDR 0x2
59#define RTE_SEC_CTX_F_FAST_SET_MDATA 0x00000001
103struct rte_security_ipsec_udp_param {
330 struct rte_security_ipsec_udp_param
udp;
345#define RTE_SECURITY_MACSEC_NUM_AN 4
347#define RTE_SECURITY_MACSEC_SALT_LEN 12
418#define RTE_SECURITY_MACSEC_VALIDATE_DISABLE 0
420#define RTE_SECURITY_MACSEC_VALIDATE_NO_DISCARD 1
422#define RTE_SECURITY_MACSEC_VALIDATE_STRICT 2
424#define RTE_SECURITY_MACSEC_VALIDATE_NO_OP 3
601#define RTE_SECURITY_TLS_1_2_IMP_NONCE_LEN 4
603#define RTE_SECURITY_TLS_1_3_IMP_NONCE_LEN 12
605#define RTE_SECURITY_DTLS_1_2_IMP_NONCE_LEN 4
973#define RTE_SECURITY_CTX_FLAGS_OFF 4
977static inline uint32_t
980 return *((uint32_t *)ctx + RTE_SECURITY_CTX_FLAGS_OFF);
990 data = (((uint32_t *)ctx) + RTE_SECURITY_CTX_FLAGS_OFF);
994#define RTE_SECURITY_SESS_OPAQUE_DATA_OFF 0
995#define RTE_SECURITY_SESS_FAST_MDATA_OFF 1
999static inline uint64_t
1002 return *((uint64_t *)sess + RTE_SECURITY_SESS_OPAQUE_DATA_OFF);
1012 data = (((uint64_t *)sess) + RTE_SECURITY_SESS_OPAQUE_DATA_OFF);
1019static inline uint64_t
1022 return *((uint64_t *)sess + RTE_SECURITY_SESS_FAST_MDATA_OFF);
1032 data = (((uint64_t *)sess) + RTE_SECURITY_SESS_FAST_MDATA_OFF);
1105struct rte_security_macsec_secy_stats {
1106 uint64_t ctl_pkt_bcast_cnt;
1107 uint64_t ctl_pkt_mcast_cnt;
1108 uint64_t ctl_pkt_ucast_cnt;
1109 uint64_t ctl_octet_cnt;
1110 uint64_t unctl_pkt_bcast_cnt;
1111 uint64_t unctl_pkt_mcast_cnt;
1112 uint64_t unctl_pkt_ucast_cnt;
1113 uint64_t unctl_octet_cnt;
1115 uint64_t octet_decrypted_cnt;
1116 uint64_t octet_validated_cnt;
1117 uint64_t pkt_port_disabled_cnt;
1118 uint64_t pkt_badtag_cnt;
1119 uint64_t pkt_nosa_cnt;
1120 uint64_t pkt_nosaerror_cnt;
1121 uint64_t pkt_tagged_ctl_cnt;
1122 uint64_t pkt_untaged_cnt;
1123 uint64_t pkt_ctl_cnt;
1124 uint64_t pkt_notag_cnt;
1126 uint64_t octet_encrypted_cnt;
1127 uint64_t octet_protected_cnt;
1128 uint64_t pkt_noactivesa_cnt;
1129 uint64_t pkt_toolong_cnt;
1130 uint64_t pkt_untagged_cnt;
1133struct rte_security_macsec_sc_stats {
1136 uint64_t pkt_invalid_cnt;
1137 uint64_t pkt_late_cnt;
1138 uint64_t pkt_notvalid_cnt;
1139 uint64_t pkt_unchecked_cnt;
1140 uint64_t pkt_delay_cnt;
1141 uint64_t pkt_ok_cnt;
1142 uint64_t octet_decrypt_cnt;
1143 uint64_t octet_validate_cnt;
1145 uint64_t pkt_encrypt_cnt;
1146 uint64_t pkt_protected_cnt;
1147 uint64_t octet_encrypt_cnt;
1148 uint64_t octet_protected_cnt;
1151struct rte_security_macsec_sa_stats {
1153 uint64_t pkt_invalid_cnt;
1154 uint64_t pkt_nosaerror_cnt;
1155 uint64_t pkt_notvalid_cnt;
1156 uint64_t pkt_ok_cnt;
1157 uint64_t pkt_nosa_cnt;
1159 uint64_t pkt_encrypt_cnt;
1160 uint64_t pkt_protected_cnt;
1163struct rte_security_ipsec_stats {
1174struct rte_security_pdcp_stats {
1178struct rte_security_docsis_stats {
1182struct rte_security_stats {
1187 struct rte_security_macsec_secy_stats macsec;
1188 struct rte_security_ipsec_stats ipsec;
1189 struct rte_security_pdcp_stats pdcp;
1190 struct rte_security_docsis_stats docsis;
1210 struct rte_security_stats *stats);
1226 struct rte_security_macsec_sa_stats *stats);
1242 struct rte_security_macsec_sc_stats *stats);
1340#define RTE_SECURITY_PDCP_ORDERING_CAP 0x00000001
1346#define RTE_SECURITY_PDCP_DUP_DETECT_CAP 0x00000002
1348#define RTE_SECURITY_TX_OLOAD_NEED_MDATA 0x00000001
1352#define RTE_SECURITY_TX_HW_TRAILER_OFFLOAD 0x00000002
1358#define RTE_SECURITY_RX_HW_TRAILER_OFFLOAD 0x00010000
1381 uint32_t capa_flags;
@ RTE_CRYPTO_OP_SECURITY_SESSION
@ RTE_CRYPTO_OP_TYPE_SYMMETRIC
#define RTE_MBUF_DYNFIELD(m, offset, type)
rte_security_session_protocol
@ RTE_SECURITY_PROTOCOL_PDCP
@ RTE_SECURITY_PROTOCOL_DOCSIS
@ RTE_SECURITY_PROTOCOL_IPSEC
@ RTE_SECURITY_PROTOCOL_MACSEC
@ RTE_SECURITY_PROTOCOL_TLS_RECORD
void * rte_security_session_create(void *instance, struct rte_security_session_conf *conf, struct rte_mempool *mp)
__rte_experimental uint16_t rte_security_inb_pkt_rx_inject(void *ctx, struct rte_mbuf **pkts, void **sess, uint16_t nb_pkts)
static bool rte_security_dynfield_is_registered(void)
int rte_security_session_destroy(void *instance, void *sess)
static void rte_security_session_fast_mdata_set(void *sess, uint64_t fdata)
int rte_security_session_update(void *instance, void *sess, struct rte_security_session_conf *conf)
int rte_security_session_stats_get(void *instance, void *sess, struct rte_security_stats *stats)
rte_security_macsec_direction
@ RTE_SECURITY_MACSEC_DIR_TX
@ RTE_SECURITY_MACSEC_DIR_RX
#define RTE_SECURITY_TLS_1_3_IMP_NONCE_LEN
unsigned int rte_security_session_get_size(void *instance)
int __rte_security_set_pkt_metadata(void *instance, void *sess, struct rte_mbuf *m, void *params)
#define RTE_SECURITY_TLS_1_2_IMP_NONCE_LEN
int rte_security_macsec_sa_stats_get(void *instance, uint16_t sa_id, enum rte_security_macsec_direction dir, struct rte_security_macsec_sa_stats *stats)
#define RTE_SEC_CTX_F_FAST_SET_MDATA
#define RTE_SECURITY_MACSEC_SALT_LEN
static uint64_t rte_security_session_fast_mdata_get(void *sess)
rte_security_pdcp_direction
@ RTE_SECURITY_PDCP_UPLINK
@ RTE_SECURITY_PDCP_DOWNLINK
@ RTE_SECURITY_VERSION_DTLS_1_2
@ RTE_SECURITY_VERSION_TLS_1_3
@ RTE_SECURITY_VERSION_TLS_1_2
int rte_security_macsec_sc_create(void *instance, struct rte_security_macsec_sc *conf)
struct rte_mbuf * rte_security_oop_dynfield_t
rte_security_ipsec_sa_protocol
@ RTE_SECURITY_IPSEC_SA_PROTO_AH
@ RTE_SECURITY_IPSEC_SA_PROTO_ESP
rte_security_session_action_type
@ RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO
@ RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL
@ RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL
@ RTE_SECURITY_ACTION_TYPE_NONE
@ RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO
static uint32_t rte_security_ctx_flags_get(void *ctx)
static int rte_security_attach_session(struct rte_crypto_op *op, void *sess)
int rte_security_oop_dynfield_offset
rte_security_ipsec_sa_direction
@ RTE_SECURITY_IPSEC_SA_DIR_INGRESS
@ RTE_SECURITY_IPSEC_SA_DIR_EGRESS
static void rte_security_session_opaque_data_set(void *sess, uint64_t opaque)
static rte_security_dynfield_t * rte_security_dynfield(struct rte_mbuf *mbuf)
__rte_experimental int rte_security_rx_inject_configure(void *ctx, uint16_t port_id, bool enable)
rte_security_ipsec_sa_mode
@ RTE_SECURITY_IPSEC_SA_MODE_TUNNEL
@ RTE_SECURITY_IPSEC_SA_MODE_TRANSPORT
@ RTE_SECURITY_PDCP_MODE_CONTROL
@ RTE_SECURITY_PDCP_MODE_SHORT_MAC
@ RTE_SECURITY_PDCP_MODE_DATA
#define RTE_SECURITY_MACSEC_NUM_AN
rte_security_docsis_direction
@ RTE_SECURITY_DOCSIS_UPLINK
@ RTE_SECURITY_DOCSIS_DOWNLINK
static int __rte_security_attach_session(struct rte_crypto_sym_op *sym_op, void *sess)
int rte_security_dynfield_offset
static int rte_security_set_pkt_metadata(void *instance, void *sess, struct rte_mbuf *mb, void *params)
static uint64_t rte_security_session_opaque_data_get(void *sess)
int rte_security_macsec_sa_create(void *instance, struct rte_security_macsec_sa *conf)
@ RTE_SECURITY_MACSEC_ALG_GCM_256
@ RTE_SECURITY_MACSEC_ALG_GCM_128
@ RTE_SECURITY_MACSEC_ALG_GCM_XPN_128
@ RTE_SECURITY_MACSEC_ALG_GCM_XPN_256
uint64_t rte_security_dynfield_t
const struct rte_security_capability * rte_security_capability_get(void *instance, struct rte_security_capability_idx *idx)
const struct rte_security_capability * rte_security_capabilities_get(void *instance)
int rte_security_macsec_sa_destroy(void *instance, uint16_t sa_id, enum rte_security_macsec_direction dir)
int rte_security_macsec_sc_destroy(void *instance, uint16_t sc_id, enum rte_security_macsec_direction dir)
int rte_security_macsec_sc_stats_get(void *instance, uint16_t sc_id, enum rte_security_macsec_direction dir, struct rte_security_macsec_sc_stats *stats)
static void rte_security_ctx_flags_set(void *ctx, uint32_t flags)
rte_security_pdcp_sn_size
@ RTE_SECURITY_PDCP_SN_SIZE_12
@ RTE_SECURITY_PDCP_SN_SIZE_18
@ RTE_SECURITY_PDCP_SN_SIZE_15
@ RTE_SECURITY_PDCP_SN_SIZE_7
@ RTE_SECURITY_PDCP_SN_SIZE_5
rte_security_tls_sess_type
@ RTE_SECURITY_TLS_SESS_TYPE_READ
@ RTE_SECURITY_TLS_SESS_TYPE_WRITE
#define RTE_SECURITY_DTLS_1_2_IMP_NONCE_LEN
rte_security_ipsec_tunnel_type
@ RTE_SECURITY_IPSEC_TUNNEL_IPV6
@ RTE_SECURITY_IPSEC_TUNNEL_IPV4
static __rte_experimental rte_security_oop_dynfield_t * rte_security_oop_dynfield(struct rte_mbuf *mbuf)
struct rte_crypto_sym_op sym[0]
struct rte_security_capability::@457::@463 tls_record
enum rte_security_tls_sess_type type
uint32_t replay_win_sz_max
uint16_t ctrl_port_enable
struct rte_security_capability::@457::@460 macsec
enum rte_security_ipsec_sa_protocol proto
struct rte_security_capability::@457::@459 ipsec
struct rte_security_capability::@457::@462 docsis
uint16_t fixed_sectag_insert
uint16_t icv_include_da_sa
enum rte_security_tls_version ver
enum rte_security_session_action_type action
enum rte_security_ipsec_sa_direction direction
enum rte_security_macsec_alg alg
struct rte_security_capability::@457::@461 pdcp
struct rte_security_ipsec_sa_options options
enum rte_security_pdcp_domain domain
enum rte_security_session_protocol protocol
enum rte_security_ipsec_sa_mode mode
uint16_t relative_sectag_insert
enum rte_security_docsis_direction direction
const struct rte_cryptodev_capabilities * crypto_capabilities
uint64_t bytes_soft_limit
uint64_t bytes_hard_limit
uint64_t packets_soft_limit
uint64_t packets_hard_limit
uint32_t ip_reassembly_en
uint32_t udp_ports_verify
uint32_t tunnel_hdr_verify
struct rte_security_ipsec_tunnel_param::@432::@435 ipv6
enum rte_security_ipsec_tunnel_type type
struct rte_ipv6_addr src_addr
struct rte_security_ipsec_tunnel_param::@432::@434 ipv4
struct rte_ipv6_addr dst_addr
struct rte_security_macsec_sa::@439 key
uint8_t salt[RTE_SECURITY_MACSEC_SALT_LEN]
enum rte_security_macsec_direction dir
uint16_t sa_id[RTE_SECURITY_MACSEC_NUM_AN]
uint8_t sa_in_use[RTE_SECURITY_MACSEC_NUM_AN]
enum rte_security_macsec_direction dir
struct rte_crypto_sym_xform * crypto_xform
enum rte_security_session_action_type action_type
enum rte_security_session_protocol protocol
uint64_t packets_soft_limit
uint64_t packets_hard_limit
uint32_t extra_padding_enable