MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ipsec_inline_dequeue

Function ipsec_inline_dequeue

dpdk/examples/ipsec-secgw/ipsec.c:927–951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

925}
926
927static inline int32_t
928ipsec_inline_dequeue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,
929 struct rte_mbuf *pkts[], uint16_t max_pkts)
930{
931 int32_t nb_pkts, ret;
932 struct ipsec_mbuf_metadata *priv;
933 struct ipsec_sa *sa;
934 struct rte_mbuf *pkt;
935
936 nb_pkts = 0;
937 while (ipsec_ctx->ol_pkts_cnt > 0 && nb_pkts < max_pkts) {
938 pkt = ipsec_ctx->ol_pkts[--ipsec_ctx->ol_pkts_cnt];
939 rte_prefetch0(pkt);
940 priv = get_priv(pkt);
941 sa = priv->sa;
942 ret = xform_func(pkt, sa, &priv->cop);
943 if (unlikely(ret)) {
944 free_pkts(&pkt, 1);
945 continue;
946 }
947 pkts[nb_pkts++] = pkt;
948 }
949
950 return nb_pkts;
951}
952
953static inline int
954ipsec_dequeue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,

Callers 2

ipsec_inboundFunction · 0.85
ipsec_outboundFunction · 0.85

Calls 3

get_privFunction · 0.85
free_pktsFunction · 0.70
rte_prefetch0Function · 0.50

Tested by

no test coverage detected