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

Function process_pkts_outbound

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

Source from the content-addressed store, hash-verified

440}
441
442static inline void
443process_pkts_outbound(struct ipsec_ctx *ipsec_ctx,
444 struct ipsec_traffic *traffic)
445{
446 struct rte_mbuf *m;
447 uint16_t idx, nb_pkts_out, i;
448 unsigned int lcoreid = rte_lcore_id();
449
450 /* Drop any IPsec traffic from protected ports */
451 free_pkts(traffic->ipsec.pkts, traffic->ipsec.num);
452
453 traffic->ipsec.num = 0;
454
455 outbound_spd_lookup(ipsec_ctx->sp4_ctx,
456 &traffic->ip4, &traffic->ipsec,
457 &core_statistics[lcoreid].outbound.spd4);
458
459 outbound_spd_lookup(ipsec_ctx->sp6_ctx,
460 &traffic->ip6, &traffic->ipsec,
461 &core_statistics[lcoreid].outbound.spd6);
462
463 if (app_sa_prm.enable == 0) {
464
465 nb_pkts_out = ipsec_outbound(ipsec_ctx, traffic->ipsec.pkts,
466 traffic->ipsec.res, traffic->ipsec.num,
467 MAX_PKT_BURST);
468
469 for (i = 0; i < nb_pkts_out; i++) {
470 m = traffic->ipsec.pkts[i];
471 struct ip *ip = rte_pktmbuf_mtod(m, struct ip *);
472 if (ip->ip_v == IPVERSION) {
473 idx = traffic->ip4.num++;
474 traffic->ip4.pkts[idx] = m;
475 } else {
476 idx = traffic->ip6.num++;
477 traffic->ip6.pkts[idx] = m;
478 }
479 }
480 } else {
481 outbound_sa_lookup(ipsec_ctx->sa_ctx, traffic->ipsec.res,
482 traffic->ipsec.saptr, traffic->ipsec.num);
483 ipsec_process(ipsec_ctx, traffic);
484 }
485}
486
487static inline void
488process_pkts_inbound_nosp(struct ipsec_ctx *ipsec_ctx,

Callers 1

process_pktsFunction · 0.85

Calls 6

rte_lcore_idFunction · 0.85
outbound_spd_lookupFunction · 0.85
ipsec_outboundFunction · 0.85
outbound_sa_lookupFunction · 0.85
ipsec_processFunction · 0.85
free_pktsFunction · 0.70

Tested by

no test coverage detected