6 #ifndef _RTE_SECURITY_H_ 7 #define _RTE_SECURITY_H_ 15 #include <sys/types.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 103 struct 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 402 uint8_t reserved : 5;
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 487 uint16_t icv_include_da_sa : 1;
489 uint16_t ctrl_port_enable : 1;
497 uint16_t reserved : 9;
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 936 static inline rte_security_dynfield_t *
940 rte_security_dynfield_offset,
941 rte_security_dynfield_t *);
955 static inline rte_security_oop_dynfield_t *
959 rte_security_oop_dynfield_offset,
960 rte_security_oop_dynfield_t *);
970 return rte_security_dynfield_offset >= 0;
973 #define RTE_SECURITY_CTX_FLAGS_OFF 4 977 static 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 999 static 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);
1019 static 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);
1105 struct 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;
1133 struct 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;
1151 struct 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;
1163 struct rte_security_ipsec_stats {
1174 struct rte_security_pdcp_stats {
1178 struct rte_security_docsis_stats {
1182 struct 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_security_pdcp_sn_size
rte_security_ipsec_sa_protocol
rte_security_tls_sess_type
uint32_t tunnel_hdr_verify
rte_security_session_action_type
rte_security_pdcp_direction
int rte_security_macsec_sa_create(void *instance, struct rte_security_macsec_sa *conf)
uint16_t relative_sectag_insert
int rte_security_macsec_sc_create(void *instance, struct rte_security_macsec_sc *conf)
#define RTE_SECURITY_TLS_1_2_IMP_NONCE_LEN
uint32_t replay_win_sz_max
struct rte_crypto_sym_xform * crypto_xform
const struct rte_security_capability * rte_security_capability_get(void *instance, struct rte_security_capability_idx *idx)
struct rte_ipv6_addr dst_addr
static __rte_experimental rte_security_oop_dynfield_t * rte_security_oop_dynfield(struct rte_mbuf *mbuf)
uint64_t bytes_hard_limit
struct rte_ipv6_addr src_addr
rte_security_ipsec_sa_mode
static void rte_security_session_fast_mdata_set(void *sess, uint64_t fdata)
static uint64_t rte_security_session_opaque_data_get(void *sess)
struct rte_security_ipsec_tunnel_param::@432::@434 ipv4
struct rte_security_ipsec_tunnel_param::@432::@435 ipv6
uint64_t bytes_soft_limit
uint32_t ip_reassembly_en
int rte_security_dynfield_offset
rte_security_ipsec_sa_direction
rte_security_ipsec_tunnel_type
int rte_security_macsec_sa_destroy(void *instance, uint16_t sa_id, enum rte_security_macsec_direction dir)
#define RTE_SECURITY_MACSEC_NUM_AN
#define RTE_MBUF_DYNFIELD(m, offset, type)
int rte_security_oop_dynfield_offset
static int rte_security_set_pkt_metadata(void *instance, void *sess, struct rte_mbuf *mb, void *params)
#define RTE_SEC_CTX_F_FAST_SET_MDATA
unsigned int rte_security_session_get_size(void *instance)
__rte_experimental int rte_security_rx_inject_configure(void *ctx, uint16_t port_id, bool enable)
uint64_t packets_soft_limit
uint32_t extra_padding_enable
const struct rte_security_capability * rte_security_capabilities_get(void *instance)
static rte_security_dynfield_t * rte_security_dynfield(struct rte_mbuf *mbuf)
static int __rte_security_attach_session(struct rte_crypto_sym_op *sym_op, void *sess)
rte_security_macsec_direction
uint16_t icv_include_da_sa
static void rte_security_session_opaque_data_set(void *sess, uint64_t opaque)
uint16_t fixed_sectag_insert
static uint32_t rte_security_ctx_flags_get(void *ctx)
int rte_security_macsec_sc_destroy(void *instance, uint16_t sc_id, enum rte_security_macsec_direction dir)
static bool rte_security_dynfield_is_registered(void)
uint32_t udp_ports_verify
static int rte_security_attach_session(struct rte_crypto_op *op, void *sess)
static uint64_t rte_security_session_fast_mdata_get(void *sess)
static void rte_security_ctx_flags_set(void *ctx, uint32_t flags)
rte_security_docsis_direction
uint64_t rte_security_dynfield_t
#define RTE_SECURITY_MACSEC_SALT_LEN
int rte_security_session_stats_get(void *instance, void *sess, struct rte_security_stats *stats)
const struct rte_cryptodev_capabilities * crypto_capabilities
enum rte_security_ipsec_tunnel_type type
void * rte_security_session_create(void *instance, struct rte_security_session_conf *conf, struct rte_mempool *mp)
uint64_t packets_hard_limit
int rte_security_session_update(void *instance, void *sess, struct rte_security_session_conf *conf)
int rte_security_session_destroy(void *instance, void *sess)
__rte_experimental uint16_t rte_security_inb_pkt_rx_inject(void *ctx, struct rte_mbuf **pkts, void **sess, uint16_t nb_pkts)
rte_security_session_protocol
uint16_t ctrl_port_enable
#define RTE_SECURITY_TLS_1_3_IMP_NONCE_LEN
uint64_t packets_soft_limit
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)
struct rte_mbuf * rte_security_oop_dynfield_t
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)
uint64_t packets_hard_limit
#define RTE_SECURITY_DTLS_1_2_IMP_NONCE_LEN
struct rte_crypto_sym_op sym[0]
int __rte_security_set_pkt_metadata(void *instance, void *sess, struct rte_mbuf *m, void *params)