X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fipsec-secgw%2Fipsec_worker.c;h=647e22df59842ccbc2d5328e7b7a64bc0fe93fbb;hb=0f27fe09ddcf500ab7fa34a1e67dec969c01b70d;hp=5fde66794ec1dabf74c2f784ebce987a0d4fc33a;hpb=9ad50c29d01d0d3e7a1f420178d795a92ca4b682;p=dpdk.git diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c index 5fde66794e..647e22df59 100644 --- a/examples/ipsec-secgw/ipsec_worker.c +++ b/examples/ipsec-secgw/ipsec_worker.c @@ -112,12 +112,7 @@ check_sp(struct sp_ctx *sp, const uint8_t *nlp, uint32_t *sa_idx) rte_acl_classify((struct rte_acl_ctx *)sp, &nlp, &res, 1, DEFAULT_MAX_CATEGORIES); - if (unlikely(res == 0)) { - /* No match */ - return 0; - } - - if (res == DISCARD) + if (unlikely(res == DISCARD)) return 0; else if (res == BYPASS) { *sa_idx = -1; @@ -213,7 +208,7 @@ process_ipsec_ev_inbound(struct ipsec_ctx *ctx, struct route_table *rt, "Inbound security offload failed\n"); goto drop_pkt_and_exit; } - sa = pkt->userdata; + sa = *(struct ipsec_sa **)rte_security_dynfield(pkt); } /* Check if we have a match */ @@ -231,7 +226,7 @@ process_ipsec_ev_inbound(struct ipsec_ctx *ctx, struct route_table *rt, "Inbound security offload failed\n"); goto drop_pkt_and_exit; } - sa = pkt->userdata; + sa = *(struct ipsec_sa **)rte_security_dynfield(pkt); } /* Check if we have a match */ @@ -362,7 +357,8 @@ process_ipsec_ev_outbound(struct ipsec_ctx *ctx, struct route_table *rt, } if (sess->security.ol_flags & RTE_SECURITY_TX_OLOAD_NEED_MDATA) - pkt->userdata = sess->security.ses; + *(struct rte_security_session **)rte_security_dynfield(pkt) = + sess->security.ses; /* Mark the packet for Tx security offload */ pkt->ol_flags |= PKT_TX_SEC_OFFLOAD; @@ -470,7 +466,10 @@ ipsec_wrkr_non_burst_int_port_drv_mode(struct eh_event_link_info *links, } /* Save security session */ - pkt->userdata = sess_tbl[port_id]; + if (rte_security_dynfield_is_registered()) + *(struct rte_security_session **) + rte_security_dynfield(pkt) = + sess_tbl[port_id]; /* Mark the packet for Tx security offload */ pkt->ol_flags |= PKT_TX_SEC_OFFLOAD;