* For the DCB forwarding test, each core is assigned on each traffic class. * * Each core is assigned a multi-stream, each stream being composed of * a RX queue to poll on a RX port for input messages, associated with * a TX queue of a TX port where to send forwarded packets. All RX and * TX queues are mapping to the same traffic class. * If VMDQ and DCB co-exist, each traffic class on diffe
| 4869 | * the same core |
| 4870 | */ |
| 4871 | static void |
| 4872 | dcb_fwd_config_setup(void) |
| 4873 | { |
| 4874 | struct rte_eth_dcb_info rxp_dcb_info, txp_dcb_info; |
| 4875 | portid_t txp, rxp = 0; |
| 4876 | queueid_t txq, rxq = 0; |
| 4877 | lcoreid_t lc_id; |
| 4878 | uint16_t nb_rx_queue, nb_tx_queue; |
| 4879 | uint16_t i, j, k, sm_id = 0; |
| 4880 | uint16_t total_tc_num; |
| 4881 | struct rte_port *port; |
| 4882 | uint8_t tc = 0; |
| 4883 | portid_t pid; |
| 4884 | int ret; |
| 4885 | |
| 4886 | /* |
| 4887 | * The fwd_config_setup() is called when the port is RTE_PORT_STARTED |
| 4888 | * or RTE_PORT_STOPPED. |
| 4889 | * |
| 4890 | * Re-configure ports to get updated mapping between tc and queue in |
| 4891 | * case the queue number of the port is changed. Skip for started ports |
| 4892 | * since modifying queue number and calling dev_configure need to stop |
| 4893 | * ports first. |
| 4894 | */ |
| 4895 | for (pid = 0; pid < nb_fwd_ports; pid++) { |
| 4896 | if (port_is_started(pid) == 1) |
| 4897 | continue; |
| 4898 | |
| 4899 | port = &ports[pid]; |
| 4900 | ret = rte_eth_dev_configure(pid, nb_rxq, nb_txq, |
| 4901 | &port->dev_conf); |
| 4902 | if (ret < 0) { |
| 4903 | fprintf(stderr, |
| 4904 | "Failed to re-configure port %d, ret = %d.\n", |
| 4905 | pid, ret); |
| 4906 | return; |
| 4907 | } |
| 4908 | } |
| 4909 | |
| 4910 | cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores; |
| 4911 | cur_fwd_config.nb_fwd_ports = nb_fwd_ports; |
| 4912 | cur_fwd_config.nb_fwd_streams = |
| 4913 | (streamid_t) (nb_rxq * cur_fwd_config.nb_fwd_ports); |
| 4914 | total_tc_num = get_fwd_port_total_tc_num(); |
| 4915 | if (cur_fwd_config.nb_fwd_lcores > total_tc_num) |
| 4916 | cur_fwd_config.nb_fwd_lcores = total_tc_num; |
| 4917 | |
| 4918 | /* reinitialize forwarding streams */ |
| 4919 | init_fwd_streams(); |
| 4920 | sm_id = 0; |
| 4921 | txp = 1; |
| 4922 | /* get the dcb info on the first RX and TX ports */ |
| 4923 | (void)rte_eth_dev_get_dcb_info(fwd_ports_ids[rxp], &rxp_dcb_info); |
| 4924 | (void)rte_eth_dev_get_dcb_info(fwd_ports_ids[txp], &txp_dcb_info); |
| 4925 | |
| 4926 | for (lc_id = 0; lc_id < cur_fwd_config.nb_fwd_lcores; lc_id++) { |
| 4927 | fwd_lcores[lc_id]->stream_nb = 0; |
| 4928 | fwd_lcores[lc_id]->stream_idx = sm_id; |
no test coverage detected