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

Function l2fwd_main_loop

dpdk/examples/l2fwd-crypto/main.c:706–971  ·  view source on GitHub ↗

main processing loop */

Source from the content-addressed store, hash-verified

704
705/* main processing loop */
706static void
707l2fwd_main_loop(struct l2fwd_crypto_options *options)
708{
709 struct rte_mbuf *m, *pkts_burst[MAX_PKT_BURST];
710 struct rte_crypto_op *ops_burst[MAX_PKT_BURST];
711
712 unsigned lcore_id = rte_lcore_id();
713 uint64_t prev_tsc = 0, diff_tsc, cur_tsc, timer_tsc = 0;
714 unsigned int i, j, nb_rx, len;
715 uint16_t portid;
716 struct lcore_queue_conf *qconf = &lcore_queue_conf[lcore_id];
717 const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) /
718 US_PER_S * BURST_TX_DRAIN_US;
719 struct l2fwd_crypto_params *cparams;
720 struct l2fwd_crypto_params port_cparams[qconf->nb_crypto_devs];
721 void *session;
722
723 if (qconf->nb_rx_ports == 0) {
724 RTE_LOG(INFO, L2FWD, "lcore %u has nothing to do\n", lcore_id);
725 return;
726 }
727
728 RTE_LOG(INFO, L2FWD, "entering main loop on lcore %u\n", lcore_id);
729
730 for (i = 0; i < qconf->nb_rx_ports; i++) {
731
732 portid = qconf->rx_port_list[i];
733 RTE_LOG(INFO, L2FWD, " -- lcoreid=%u portid=%u\n", lcore_id,
734 portid);
735 }
736
737 for (i = 0; i < qconf->nb_crypto_devs; i++) {
738 port_cparams[i].do_cipher = 0;
739 port_cparams[i].do_hash = 0;
740 port_cparams[i].do_aead = 0;
741
742 switch (options->xform_chain) {
743 case L2FWD_CRYPTO_AEAD:
744 port_cparams[i].do_aead = 1;
745 break;
746 case L2FWD_CRYPTO_CIPHER_HASH:
747 case L2FWD_CRYPTO_HASH_CIPHER:
748 port_cparams[i].do_cipher = 1;
749 port_cparams[i].do_hash = 1;
750 break;
751 case L2FWD_CRYPTO_HASH_ONLY:
752 port_cparams[i].do_hash = 1;
753 break;
754 case L2FWD_CRYPTO_CIPHER_ONLY:
755 port_cparams[i].do_cipher = 1;
756 break;
757 }
758
759 port_cparams[i].dev_id = qconf->cryptodev_list[i];
760 port_cparams[i].qp_id = 0;
761
762 port_cparams[i].block_size = options->block_size;
763

Callers 1

l2fwd_launch_one_lcoreFunction · 0.70

Calls 15

rte_lcore_idFunction · 0.85
rte_get_tsc_hzFunction · 0.85
generate_random_keyFunction · 0.85
rte_exitFunction · 0.85
l2fwd_crypto_send_burstFunction · 0.85
l2fwd_send_burstFunction · 0.85
rte_get_main_lcoreFunction · 0.85
rte_eth_rx_burstFunction · 0.85
rte_crypto_op_bulk_allocFunction · 0.85
rte_pktmbuf_freeFunction · 0.85

Tested by

no test coverage detected