examples/ipsec-secgw: add poll mode worker for inline proto
[dpdk.git] / examples / ipsec-secgw / esp.c
index c1b49da..bd23375 100644 (file)
@@ -155,12 +155,12 @@ esp_inbound_post(struct rte_mbuf *m, struct ipsec_sa *sa,
        RTE_ASSERT(sa != NULL);
        RTE_ASSERT(cop != NULL);
 
-       ips = ipsec_get_session(sa);
+       ips = ipsec_get_primary_session(sa);
 
        if ((ips->type == RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL) ||
                        (ips->type == RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO)) {
-               if (m->ol_flags & PKT_RX_SEC_OFFLOAD) {
-                       if (m->ol_flags & PKT_RX_SEC_OFFLOAD_FAILED)
+               if (m->ol_flags & RTE_MBUF_F_RX_SEC_OFFLOAD) {
+                       if (m->ol_flags & RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED)
                                cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
                        else
                                cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
@@ -234,7 +234,7 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa,
        RTE_ASSERT(m != NULL);
        RTE_ASSERT(sa != NULL);
 
-       ips = ipsec_get_session(sa);
+       ips = ipsec_get_primary_session(sa);
        ip_hdr_len = 0;
 
        ip4 = rte_pktmbuf_mtod(m, struct ip *);
@@ -464,7 +464,7 @@ esp_outbound_post(struct rte_mbuf *m,
 
        if ((type == RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL) ||
                        (type == RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO)) {
-               m->ol_flags |= PKT_TX_SEC_OFFLOAD;
+               m->ol_flags |= RTE_MBUF_F_TX_SEC_OFFLOAD;
        } else {
                RTE_ASSERT(cop != NULL);
                if (cop->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {