* Copyright(C) 2021 Marvell.
*/
+#include <rte_udp.h>
+
#include "cnxk_security.h"
static int
return -ENOTSUP;
}
+ /* Set encapsulation type */
+ if (ipsec_xfrm->options.udp_encap)
+ w2->s.encap_type = ROC_IE_OT_SA_ENCAP_UDP;
+
w2->s.spi = ipsec_xfrm->spi;
/* Copy encryption key */
/* ESN */
sa->w2.s.esn_en = !!ipsec_xfrm->options.esn;
+ if (ipsec_xfrm->options.udp_encap) {
+ sa->w10.s.udp_src_port = 4500;
+ sa->w10.s.udp_dst_port = 4500;
+ }
offset = offsetof(struct roc_ot_ipsec_inb_sa, ctx);
/* Word offset for HW managed SA field */
/* ESN */
sa->w0.s.esn_en = !!ipsec_xfrm->options.esn;
+ if (ipsec_xfrm->options.udp_encap) {
+ sa->w10.s.udp_src_port = 4500;
+ sa->w10.s.udp_dst_port = 4500;
+ }
+
offset = offsetof(struct roc_ot_ipsec_outb_sa, ctx);
/* Word offset for HW managed SA field */
sa->w0.s.hw_ctx_off = offset / 8;
partial_len += cnxk_ipsec_icvlen_get(c_algo, a_algo, aead_algo);
roundup_byte = cnxk_ipsec_outb_roundup_byte(c_algo, aead_algo);
+ if (ipsec_xfrm->options.udp_encap)
+ partial_len += sizeof(struct rte_udp_hdr);
+
rlens->partial_len = partial_len;
rlens->roundup_len = roundup_len;
rlens->roundup_byte = roundup_byte;