| 1682 | } |
| 1683 | |
| 1684 | static void |
| 1685 | init_config(void) |
| 1686 | { |
| 1687 | portid_t pid; |
| 1688 | struct rte_mempool *mbp; |
| 1689 | unsigned int nb_mbuf_per_pool; |
| 1690 | lcoreid_t lc_id; |
| 1691 | #ifdef RTE_LIB_GRO |
| 1692 | struct rte_gro_param gro_param; |
| 1693 | #endif |
| 1694 | #ifdef RTE_LIB_GSO |
| 1695 | uint32_t gso_types; |
| 1696 | #endif |
| 1697 | |
| 1698 | /* Configuration of logical cores. */ |
| 1699 | fwd_lcores = rte_zmalloc("testpmd: fwd_lcores", |
| 1700 | sizeof(struct fwd_lcore *) * nb_lcores, |
| 1701 | RTE_CACHE_LINE_SIZE); |
| 1702 | if (fwd_lcores == NULL) { |
| 1703 | rte_exit(EXIT_FAILURE, "rte_zmalloc(%d (struct fwd_lcore *)) " |
| 1704 | "failed\n", nb_lcores); |
| 1705 | } |
| 1706 | for (lc_id = 0; lc_id < nb_lcores; lc_id++) { |
| 1707 | fwd_lcores[lc_id] = rte_zmalloc("testpmd: struct fwd_lcore", |
| 1708 | sizeof(struct fwd_lcore), |
| 1709 | RTE_CACHE_LINE_SIZE); |
| 1710 | if (fwd_lcores[lc_id] == NULL) { |
| 1711 | rte_exit(EXIT_FAILURE, "rte_zmalloc(struct fwd_lcore) " |
| 1712 | "failed\n"); |
| 1713 | } |
| 1714 | fwd_lcores[lc_id]->cpuid_idx = lc_id; |
| 1715 | } |
| 1716 | |
| 1717 | RTE_ETH_FOREACH_DEV(pid) { |
| 1718 | uint32_t socket_id; |
| 1719 | |
| 1720 | if (numa_support) { |
| 1721 | socket_id = port_numa[pid]; |
| 1722 | if (port_numa[pid] == NUMA_NO_CONFIG) { |
| 1723 | socket_id = rte_eth_dev_socket_id(pid); |
| 1724 | |
| 1725 | /* |
| 1726 | * if socket_id is invalid, |
| 1727 | * set to the first available socket. |
| 1728 | */ |
| 1729 | if (check_socket_id(socket_id) < 0) |
| 1730 | socket_id = socket_ids[0]; |
| 1731 | } |
| 1732 | } else { |
| 1733 | socket_id = (socket_num == UMA_NO_CONFIG) ? |
| 1734 | 0 : socket_num; |
| 1735 | } |
| 1736 | /* Apply default TxRx configuration for all ports */ |
| 1737 | init_config_port_offloads(pid, socket_id); |
| 1738 | } |
| 1739 | /* |
| 1740 | * Create pools of mbuf. |
| 1741 | * If NUMA support is disabled, create a single pool of mbuf in |
no test coverage detected