X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcrypto%2Focteontx2%2Fotx2_ipsec_fp.h;h=a33041d77c7a58f695fa2217ca4f884990bcca86;hb=e863fe3a13da89787fdf3b5c590101a3c0f10af6;hp=52b3b41e23a99d776773052e55631f45f21dcb90;hpb=f44e7163775537e64424ea0ccdb0a75c589c50ef;p=dpdk.git diff --git a/drivers/crypto/octeontx2/otx2_ipsec_fp.h b/drivers/crypto/octeontx2/otx2_ipsec_fp.h index 52b3b41e23..a33041d77c 100644 --- a/drivers/crypto/octeontx2/otx2_ipsec_fp.h +++ b/drivers/crypto/octeontx2/otx2_ipsec_fp.h @@ -8,6 +8,17 @@ #include #include +/* Macros for anti replay and ESN */ +#define OTX2_IPSEC_MAX_REPLAY_WIN_SZ 1024 +#define OTX2_IPSEC_SAINDEX_SZ 4 +#define OTX2_IPSEC_SEQNO_LO 4 + +#define OTX2_IPSEC_SEQNO_LO_INDEX (RTE_ETHER_HDR_LEN + \ + OTX2_IPSEC_SAINDEX_SZ) + +#define OTX2_IPSEC_SEQNO_HI_INDEX (OTX2_IPSEC_SEQNO_LO_INDEX + \ + OTX2_IPSEC_SEQNO_LO) + enum { OTX2_IPSEC_FP_SA_DIRECTION_INBOUND = 0, OTX2_IPSEC_FP_SA_DIRECTION_OUTBOUND = 1, @@ -105,6 +116,14 @@ struct otx2_ipsec_fp_out_sa { uint8_t hmac_key[48]; }; +struct otx2_ipsec_replay { + rte_spinlock_t lock; + uint32_t winb; + uint32_t wint; + uint64_t base; /**< base of the anti-replay window */ + uint64_t window[17]; /**< anti-replay window */ +}; + struct otx2_ipsec_fp_in_sa { /* w0 */ struct otx2_ipsec_fp_sa_ctl ctl; @@ -114,8 +133,8 @@ struct otx2_ipsec_fp_in_sa { uint32_t unused; /* w2 */ - uint32_t esn_low; uint32_t esn_hi; + uint32_t esn_low; /* w3-w6 */ uint8_t cipher_key[32]; @@ -128,9 +147,13 @@ struct otx2_ipsec_fp_in_sa { void *userdata; uint64_t udata64; }; + union { + struct otx2_ipsec_replay *replay; + uint64_t replay64; + }; + uint32_t replay_win_sz; - uint64_t reserved1; - uint64_t reserved2; + uint32_t reserved1; }; static inline int