| 2731 | } |
| 2732 | |
| 2733 | int |
| 2734 | main(int argc, char **argv) |
| 2735 | { |
| 2736 | struct lcore_queue_conf *qconf = NULL; |
| 2737 | struct l2fwd_crypto_options options; |
| 2738 | |
| 2739 | uint8_t nb_cryptodevs, cdev_id; |
| 2740 | uint16_t portid; |
| 2741 | unsigned lcore_id, rx_lcore_id = 0; |
| 2742 | int ret, enabled_cdevcount, enabled_portcount; |
| 2743 | uint8_t enabled_cdevs[RTE_CRYPTO_MAX_DEVS] = {0}; |
| 2744 | |
| 2745 | signal(SIGINT, raise_signal); |
| 2746 | signal(SIGTERM, raise_signal); |
| 2747 | |
| 2748 | /* init EAL */ |
| 2749 | ret = rte_eal_init(argc, argv); |
| 2750 | if (ret < 0) |
| 2751 | rte_exit(EXIT_FAILURE, "Invalid EAL arguments\n"); |
| 2752 | argc -= ret; |
| 2753 | argv += ret; |
| 2754 | |
| 2755 | /* reserve memory for Cipher/Auth key and IV */ |
| 2756 | reserve_key_memory(&options); |
| 2757 | |
| 2758 | /* parse application arguments (after the EAL ones) */ |
| 2759 | ret = l2fwd_crypto_parse_args(&options, argc, argv); |
| 2760 | if (ret < 0) |
| 2761 | rte_exit(EXIT_FAILURE, "Invalid L2FWD-CRYPTO arguments\n"); |
| 2762 | |
| 2763 | printf("MAC updating %s\n", |
| 2764 | options.mac_updating ? "enabled" : "disabled"); |
| 2765 | |
| 2766 | /* create the mbuf pool */ |
| 2767 | l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 512, |
| 2768 | RTE_ALIGN(sizeof(struct rte_crypto_op), |
| 2769 | RTE_CACHE_LINE_SIZE), |
| 2770 | RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id()); |
| 2771 | if (l2fwd_pktmbuf_pool == NULL) |
| 2772 | rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n"); |
| 2773 | |
| 2774 | /* create crypto op pool */ |
| 2775 | l2fwd_crypto_op_pool = rte_crypto_op_pool_create("crypto_op_pool", |
| 2776 | RTE_CRYPTO_OP_TYPE_SYMMETRIC, NB_MBUF, 128, MAXIMUM_IV_LENGTH, |
| 2777 | rte_socket_id()); |
| 2778 | if (l2fwd_crypto_op_pool == NULL) |
| 2779 | rte_exit(EXIT_FAILURE, "Cannot create crypto op pool\n"); |
| 2780 | |
| 2781 | /* Enable Ethernet ports */ |
| 2782 | enabled_portcount = initialize_ports(&options); |
| 2783 | if (enabled_portcount < 1) |
| 2784 | rte_exit(EXIT_FAILURE, "Failed to initialize Ethernet ports\n"); |
| 2785 | |
| 2786 | /* Initialize the port/queue configuration of each logical core */ |
| 2787 | RTE_ETH_FOREACH_DEV(portid) { |
| 2788 | |
| 2789 | /* skip ports that are not enabled */ |
| 2790 | if ((options.portmask & (1 << portid)) == 0) |
nothing calls this directly
no test coverage detected