event/cnxk: fix clang build on Arm
[dpdk.git] / examples / ipsec-secgw / ipsec_worker.c
index b6c851f..647e22d 100644 (file)
@@ -208,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 */
@@ -226,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 */
@@ -357,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;
@@ -465,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;