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

Function ipsec_poll_mode_worker

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

main processing loop */

Source from the content-addressed store, hash-verified

692
693/* main processing loop */
694void
695ipsec_poll_mode_worker(void)
696{
697 struct rte_mbuf *pkts[MAX_PKT_BURST];
698 uint32_t lcore_id;
699 uint64_t prev_tsc, diff_tsc, cur_tsc;
700 uint16_t i, nb_rx, portid, queueid;
701 struct lcore_conf *qconf;
702 int32_t rc, socket_id;
703 const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1)
704 / US_PER_S * BURST_TX_DRAIN_US;
705 struct lcore_rx_queue *rxql;
706
707 prev_tsc = 0;
708 lcore_id = rte_lcore_id();
709 qconf = &lcore_conf[lcore_id];
710 rxql = qconf->rx_queue_list;
711 socket_id = rte_lcore_to_socket_id(lcore_id);
712
713 qconf->rt4_ctx = socket_ctx[socket_id].rt_ip4;
714 qconf->rt6_ctx = socket_ctx[socket_id].rt_ip6;
715 qconf->inbound.sp4_ctx = socket_ctx[socket_id].sp_ip4_in;
716 qconf->inbound.sp6_ctx = socket_ctx[socket_id].sp_ip6_in;
717 qconf->inbound.sa_ctx = socket_ctx[socket_id].sa_in;
718 qconf->inbound.cdev_map = cdev_map_in;
719 qconf->inbound.lcore_id = lcore_id;
720 qconf->outbound.sp4_ctx = socket_ctx[socket_id].sp_ip4_out;
721 qconf->outbound.sp6_ctx = socket_ctx[socket_id].sp_ip6_out;
722 qconf->outbound.sa_ctx = socket_ctx[socket_id].sa_out;
723 qconf->outbound.cdev_map = cdev_map_out;
724 qconf->outbound.lcore_id = lcore_id;
725 qconf->frag.pool_indir = socket_ctx[socket_id].mbuf_pool_indir;
726
727 rc = ipsec_sad_lcore_cache_init(app_sa_prm.cache_sz);
728 if (rc != 0) {
729 RTE_LOG(ERR, IPSEC,
730 "SAD cache init on lcore %u, failed with code: %d\n",
731 lcore_id, rc);
732 return;
733 }
734
735 if (qconf->nb_rx_queue == 0) {
736 RTE_LOG(DEBUG, IPSEC, "lcore %u has nothing to do\n",
737 lcore_id);
738 return;
739 }
740
741 RTE_LOG(INFO, IPSEC, "entering main loop on lcore %u\n", lcore_id);
742
743 for (i = 0; i < qconf->nb_rx_queue; i++) {
744 portid = rxql[i].port_id;
745 queueid = rxql[i].queue_id;
746 RTE_LOG(INFO, IPSEC,
747 " -- lcoreid=%u portid=%u rxqueueid=%" PRIu16 "\n",
748 lcore_id, portid, queueid);
749 }
750
751 while (!force_quit) {

Callers

nothing calls this directly

Calls 13

rte_get_tsc_hzFunction · 0.85
rte_lcore_idFunction · 0.85
rte_lcore_to_socket_idFunction · 0.85
drain_tx_buffersFunction · 0.85
drain_crypto_buffersFunction · 0.85
rte_eth_rx_burstFunction · 0.85
core_stats_update_rxFunction · 0.85
process_pktsFunction · 0.85
is_unprotected_portFunction · 0.85

Tested by

no test coverage detected