#include <rte_ip.h>
#include <rte_udp.h>
#include <rte_errno.h>
-#include <rte_cryptodev.h>
#include "sa.h"
#include "ipsec_sqn.h"
#include "crypto.h"
-#include "iph.h"
#include "misc.h"
-#include "pad.h"
#define MBUF_MAX_L2_LEN RTE_LEN2MASK(RTE_MBUF_L2_LEN_BITS, uint64_t)
#define MBUF_MAX_L3_LEN RTE_LEN2MASK(RTE_MBUF_L3_LEN_BITS, uint64_t)
/*
* RFC 4303 recommends 64 as minimum window size.
* there is no point to use ESN mode without SQN window,
- * so make sure we have at least 64 window when ESN is enalbed.
+ * so make sure we have at least 64 window when ESN is enabled.
*/
wsz = ((type & RTE_IPSEC_SATP_ESN_MASK) ==
RTE_IPSEC_SATP_ESN_DISABLE) ?
memcpy(sa->hdr, prm->tun.hdr, prm->tun.hdr_len);
- /* insert UDP header if UDP encapsulation is inabled */
+ /* insert UDP header if UDP encapsulation is enabled */
if (sa->type & RTE_IPSEC_SATP_NATT_ENABLE) {
struct rte_udp_hdr *udph = (struct rte_udp_hdr *)
&sa->hdr[prm->tun.hdr_len];
sa->hdr_len += sizeof(struct rte_udp_hdr);
- udph->src_port = prm->ipsec_xform.udp.sport;
- udph->dst_port = prm->ipsec_xform.udp.dport;
+ udph->src_port = rte_cpu_to_be_16(prm->ipsec_xform.udp.sport);
+ udph->dst_port = rte_cpu_to_be_16(prm->ipsec_xform.udp.dport);
udph->dgram_cksum = 0;
}
k = 0;
bytes = 0;
for (i = 0; i != num; i++) {
- if ((mb[i]->ol_flags & PKT_RX_SEC_OFFLOAD_FAILED) == 0) {
+ if ((mb[i]->ol_flags & RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED) == 0) {
k++;
bytes += mb[i]->pkt_len;
}