| 4977 | } |
| 4978 | |
| 4979 | static void |
| 4980 | icmp_echo_config_setup(void) |
| 4981 | { |
| 4982 | portid_t rxp; |
| 4983 | queueid_t rxq; |
| 4984 | lcoreid_t lc_id; |
| 4985 | uint16_t sm_id; |
| 4986 | |
| 4987 | if ((lcoreid_t)(nb_txq * nb_fwd_ports) < nb_fwd_lcores) |
| 4988 | cur_fwd_config.nb_fwd_lcores = (lcoreid_t) |
| 4989 | (nb_txq * nb_fwd_ports); |
| 4990 | else |
| 4991 | cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores; |
| 4992 | cur_fwd_config.nb_fwd_ports = nb_fwd_ports; |
| 4993 | cur_fwd_config.nb_fwd_streams = |
| 4994 | (streamid_t) (nb_rxq * cur_fwd_config.nb_fwd_ports); |
| 4995 | if (cur_fwd_config.nb_fwd_streams < cur_fwd_config.nb_fwd_lcores) |
| 4996 | cur_fwd_config.nb_fwd_lcores = |
| 4997 | (lcoreid_t)cur_fwd_config.nb_fwd_streams; |
| 4998 | if (verbose_level > 0) { |
| 4999 | printf("%s fwd_cores=%d fwd_ports=%d fwd_streams=%d\n", |
| 5000 | __FUNCTION__, |
| 5001 | cur_fwd_config.nb_fwd_lcores, |
| 5002 | cur_fwd_config.nb_fwd_ports, |
| 5003 | cur_fwd_config.nb_fwd_streams); |
| 5004 | } |
| 5005 | |
| 5006 | /* reinitialize forwarding streams */ |
| 5007 | init_fwd_streams(); |
| 5008 | setup_fwd_config_of_each_lcore(&cur_fwd_config); |
| 5009 | rxp = 0; rxq = 0; |
| 5010 | for (lc_id = 0; lc_id < cur_fwd_config.nb_fwd_lcores; lc_id++) { |
| 5011 | if (verbose_level > 0) |
| 5012 | printf(" core=%d: \n", lc_id); |
| 5013 | for (sm_id = 0; sm_id < fwd_lcores[lc_id]->stream_nb; sm_id++) { |
| 5014 | struct fwd_stream *fs; |
| 5015 | fs = fwd_streams[fwd_lcores[lc_id]->stream_idx + sm_id]; |
| 5016 | fs->rx_port = fwd_ports_ids[rxp]; |
| 5017 | fs->rx_queue = rxq; |
| 5018 | fs->tx_port = fs->rx_port; |
| 5019 | fs->tx_queue = rxq; |
| 5020 | fs->peer_addr = fs->tx_port; |
| 5021 | fs->retry_enabled = retry_enabled; |
| 5022 | if (verbose_level > 0) |
| 5023 | printf(" stream=%d port=%d rxq=%d txq=%d\n", |
| 5024 | sm_id, fs->rx_port, fs->rx_queue, |
| 5025 | fs->tx_queue); |
| 5026 | rxq = (queueid_t) (rxq + 1); |
| 5027 | if (rxq == nb_rxq) { |
| 5028 | rxq = 0; |
| 5029 | rxp = (portid_t) (rxp + 1); |
| 5030 | } |
| 5031 | } |
| 5032 | } |
| 5033 | } |
| 5034 | |
| 5035 | void |
| 5036 | fwd_config_setup(void) |
no test coverage detected