Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause 2 : : * Copyright(C) 2024 Marvell. 3 : : */ 4 : : 5 : : 6 : : #include "roc_api.h" 7 : : #include "roc_priv.h" 8 : : 9 : : void 10 : 0 : roc_ow_ipsec_inb_sa_init(struct roc_ow_ipsec_inb_sa *sa) 11 : : { 12 : : size_t offset; 13 : : 14 : : memset(sa, 0, sizeof(struct roc_ow_ipsec_inb_sa)); 15 : : 16 : 0 : sa->w0.s.pkt_output = ROC_IE_OW_SA_PKT_OUTPUT_NO_FRAG; 17 : 0 : sa->w0.s.pkt_format = ROC_IE_OW_SA_PKT_FMT_META; 18 : 0 : sa->w0.s.pkind = ROC_IE_OW_CPT_PKIND; 19 : 0 : sa->w0.s.et_ovrwr = 1; 20 : 0 : sa->w2.s.l3hdr_on_err = 1; 21 : : 22 : : offset = offsetof(struct roc_ow_ipsec_inb_sa, ctx); 23 : 0 : sa->w0.s.hw_ctx_off = offset / ROC_CTX_UNIT_8B; 24 : 0 : sa->w0.s.ctx_push_size = sa->w0.s.hw_ctx_off + 1; 25 : 0 : sa->w0.s.ctx_size = ROC_IE_OW_CTX_ILEN; 26 : 0 : sa->w0.s.ctx_hdr_size = ROC_IE_OW_SA_CTX_HDR_SIZE; 27 : 0 : sa->w0.s.aop_valid = 1; 28 : 0 : } 29 : : 30 : : void 31 : 0 : roc_ow_reass_inb_sa_init(struct roc_ow_ipsec_inb_sa *sa) 32 : : { 33 : : size_t offset; 34 : : 35 : : memset(sa, 0, sizeof(struct roc_ow_ipsec_inb_sa)); 36 : : 37 : 0 : sa->w0.s.pkt_output = ROC_IE_OW_SA_PKT_OUTPUT_HW_BASED_DEFRAG; 38 : 0 : sa->w0.s.pkt_format = ROC_IE_OW_SA_PKT_FMT_META; 39 : 0 : sa->w0.s.pkind = ROC_IE_OW_CPT_PKIND; 40 : 0 : sa->w2.s.l3hdr_on_err = 1; 41 : 0 : sa->w2.s.valid = 1; 42 : : sa->w2.s.dir = ROC_IE_SA_DIR_INBOUND; 43 : : 44 : : offset = offsetof(struct roc_ow_ipsec_inb_sa, ctx); 45 : 0 : sa->w0.s.hw_ctx_off = offset / ROC_CTX_UNIT_8B; 46 : 0 : sa->w0.s.ctx_push_size = sa->w0.s.hw_ctx_off + 1; 47 : 0 : sa->w0.s.ctx_size = ROC_IE_OW_CTX_ILEN; 48 : 0 : sa->w0.s.ctx_hdr_size = ROC_IE_OW_SA_CTX_HDR_SIZE; 49 : 0 : sa->w0.s.aop_valid = 1; 50 : 0 : } 51 : : 52 : : void 53 : 0 : roc_ow_ipsec_outb_sa_init(struct roc_ow_ipsec_outb_sa *sa) 54 : : { 55 : : size_t offset; 56 : : 57 : : memset(sa, 0, sizeof(struct roc_ow_ipsec_outb_sa)); 58 : : 59 : : offset = offsetof(struct roc_ow_ipsec_outb_sa, ctx); 60 : 0 : sa->w0.s.ctx_push_size = (offset / ROC_CTX_UNIT_8B) + 1; 61 : 0 : sa->w0.s.ctx_size = ROC_IE_OW_CTX_ILEN; 62 : 0 : sa->w0.s.aop_valid = 1; 63 : 0 : }