6 #ifndef _RTE_SECURITY_H_ 7 #define _RTE_SECURITY_H_ 19 #include <sys/types.h> 21 #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 83 #define RTE_SEC_CTX_F_FAST_SET_MDATA 0x00000001 100 struct in_addr src_ip;
102 struct in_addr dst_ip;
128 struct rte_security_ipsec_udp_param {
353 struct rte_security_ipsec_udp_param udp;
368 #define RTE_SECURITY_MACSEC_NUM_AN 4 370 #define RTE_SECURITY_MACSEC_SALT_LEN 12 425 uint8_t reserved : 5;
441 #define RTE_SECURITY_MACSEC_VALIDATE_DISABLE 0 443 #define RTE_SECURITY_MACSEC_VALIDATE_NO_DISCARD 1 445 #define RTE_SECURITY_MACSEC_VALIDATE_STRICT 2 447 #define RTE_SECURITY_MACSEC_VALIDATE_NO_OP 3 510 uint16_t icv_include_da_sa : 1;
512 uint16_t ctrl_port_enable : 1;
520 uint16_t reserved : 9;
838 static inline rte_security_dynfield_t *
842 rte_security_dynfield_offset,
843 rte_security_dynfield_t *);
857 return rte_security_dynfield_offset >= 0;
860 #define RTE_SECURITY_SESS_OPAQUE_DATA_OFF 0 861 #define RTE_SECURITY_SESS_FAST_MDATA_OFF 1 865 static inline uint64_t
868 return *((uint64_t *)sess + RTE_SECURITY_SESS_OPAQUE_DATA_OFF);
878 data = (((uint64_t *)sess) + RTE_SECURITY_SESS_OPAQUE_DATA_OFF);
885 static inline uint64_t
888 return *((uint64_t *)sess + RTE_SECURITY_SESS_FAST_MDATA_OFF);
898 data = (((uint64_t *)sess) + RTE_SECURITY_SESS_FAST_MDATA_OFF);
972 struct rte_security_macsec_secy_stats {
973 uint64_t ctl_pkt_bcast_cnt;
974 uint64_t ctl_pkt_mcast_cnt;
975 uint64_t ctl_pkt_ucast_cnt;
976 uint64_t ctl_octet_cnt;
977 uint64_t unctl_pkt_bcast_cnt;
978 uint64_t unctl_pkt_mcast_cnt;
979 uint64_t unctl_pkt_ucast_cnt;
980 uint64_t unctl_octet_cnt;
982 uint64_t octet_decrypted_cnt;
983 uint64_t octet_validated_cnt;
984 uint64_t pkt_port_disabled_cnt;
985 uint64_t pkt_badtag_cnt;
986 uint64_t pkt_nosa_cnt;
987 uint64_t pkt_nosaerror_cnt;
988 uint64_t pkt_tagged_ctl_cnt;
989 uint64_t pkt_untaged_cnt;
990 uint64_t pkt_ctl_cnt;
991 uint64_t pkt_notag_cnt;
993 uint64_t octet_encrypted_cnt;
994 uint64_t octet_protected_cnt;
995 uint64_t pkt_noactivesa_cnt;
996 uint64_t pkt_toolong_cnt;
997 uint64_t pkt_untagged_cnt;
1000 struct rte_security_macsec_sc_stats {
1003 uint64_t pkt_invalid_cnt;
1004 uint64_t pkt_late_cnt;
1005 uint64_t pkt_notvalid_cnt;
1006 uint64_t pkt_unchecked_cnt;
1007 uint64_t pkt_delay_cnt;
1008 uint64_t pkt_ok_cnt;
1009 uint64_t octet_decrypt_cnt;
1010 uint64_t octet_validate_cnt;
1012 uint64_t pkt_encrypt_cnt;
1013 uint64_t pkt_protected_cnt;
1014 uint64_t octet_encrypt_cnt;
1015 uint64_t octet_protected_cnt;
1018 struct rte_security_macsec_sa_stats {
1020 uint64_t pkt_invalid_cnt;
1021 uint64_t pkt_nosaerror_cnt;
1022 uint64_t pkt_notvalid_cnt;
1023 uint64_t pkt_ok_cnt;
1024 uint64_t pkt_nosa_cnt;
1026 uint64_t pkt_encrypt_cnt;
1027 uint64_t pkt_protected_cnt;
1030 struct rte_security_ipsec_stats {
1041 struct rte_security_pdcp_stats {
1045 struct rte_security_docsis_stats {
1049 struct rte_security_stats {
1055 struct rte_security_macsec_secy_stats macsec;
1056 struct rte_security_ipsec_stats ipsec;
1057 struct rte_security_pdcp_stats pdcp;
1058 struct rte_security_docsis_stats docsis;
1079 struct rte_security_stats *stats);
1099 struct rte_security_macsec_sa_stats *stats);
1119 struct rte_security_macsec_sc_stats *stats);
1207 #define RTE_SECURITY_PDCP_ORDERING_CAP 0x00000001 1213 #define RTE_SECURITY_PDCP_DUP_DETECT_CAP 0x00000002 1215 #define RTE_SECURITY_TX_OLOAD_NEED_MDATA 0x00000001 1219 #define RTE_SECURITY_TX_HW_TRAILER_OFFLOAD 0x00000002 1225 #define RTE_SECURITY_RX_HW_TRAILER_OFFLOAD 0x00010000 1249 uint32_t capa_flags;
rte_security_pdcp_sn_size
rte_security_ipsec_sa_protocol
uint32_t tunnel_hdr_verify
struct rte_ether_addr src_addr
rte_security_session_action_type
rte_security_pdcp_direction
uint16_t relative_sectag_insert
__rte_experimental int rte_security_macsec_sa_create(struct rte_security_ctx *instance, struct rte_security_macsec_sa *conf)
const struct rte_security_capability * rte_security_capabilities_get(struct rte_security_ctx *instance)
unsigned int rte_security_session_get_size(struct rte_security_ctx *instance)
static int rte_security_set_pkt_metadata(struct rte_security_ctx *instance, void *sess, struct rte_mbuf *mb, void *params)
uint32_t replay_win_sz_max
struct rte_crypto_sym_xform * crypto_xform
static __rte_experimental rte_security_dynfield_t * rte_security_dynfield(struct rte_mbuf *mbuf)
uint64_t bytes_hard_limit
__rte_experimental int rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id, enum rte_security_macsec_direction dir)
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)
void * rte_security_session_create(struct rte_security_ctx *instance, struct rte_security_session_conf *conf, struct rte_mempool *mp)
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
struct rte_ether_addr dst_addr
#define RTE_SECURITY_MACSEC_NUM_AN
#define RTE_MBUF_DYNFIELD(m, offset, type)
int rte_security_session_destroy(struct rte_security_ctx *instance, void *sess)
__rte_experimental int rte_security_session_update(struct rte_security_ctx *instance, void *sess, struct rte_security_session_conf *conf)
#define RTE_SEC_CTX_F_FAST_SET_MDATA
__rte_experimental int rte_security_macsec_sc_create(struct rte_security_ctx *instance, struct rte_security_macsec_sc *conf)
__rte_experimental int rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id, enum rte_security_macsec_direction dir)
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
__rte_experimental int rte_security_macsec_sc_stats_get(struct rte_security_ctx *instance, uint16_t sc_id, enum rte_security_macsec_direction dir, struct rte_security_macsec_sc_stats *stats)
static void rte_security_session_opaque_data_set(void *sess, uint64_t opaque)
static __rte_experimental bool rte_security_dynfield_is_registered(void)
uint16_t fixed_sectag_insert
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)
__rte_experimental int rte_security_session_stats_get(struct rte_security_ctx *instance, void *sess, struct rte_security_stats *stats)
rte_security_docsis_direction
uint64_t rte_security_dynfield_t
#define RTE_SECURITY_MACSEC_SALT_LEN
const struct rte_security_capability * rte_security_capability_get(struct rte_security_ctx *instance, struct rte_security_capability_idx *idx)
const struct rte_cryptodev_capabilities * crypto_capabilities
__rte_experimental int rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance, uint16_t sa_id, enum rte_security_macsec_direction dir, struct rte_security_macsec_sa_stats *stats)
uint64_t packets_hard_limit
rte_security_session_protocol
uint16_t ctrl_port_enable
uint64_t packets_soft_limit
__rte_experimental int __rte_security_set_pkt_metadata(struct rte_security_ctx *instance, void *sess, struct rte_mbuf *m, void *params)
const struct rte_security_ops * ops
struct rte_crypto_sym_op sym[0]