| 1198 | } |
| 1199 | |
| 1200 | static int |
| 1201 | cpfl_hairpin_bind(struct rte_eth_dev *dev, uint16_t rx_port) |
| 1202 | { |
| 1203 | struct cpfl_vport *cpfl_tx_vport = dev->data->dev_private; |
| 1204 | struct idpf_vport *tx_vport = &cpfl_tx_vport->base; |
| 1205 | struct cpfl_vport *cpfl_rx_vport; |
| 1206 | struct cpfl_tx_queue *cpfl_txq; |
| 1207 | struct cpfl_rx_queue *cpfl_rxq; |
| 1208 | struct rte_eth_dev *peer_dev; |
| 1209 | struct idpf_vport *rx_vport; |
| 1210 | int err = 0; |
| 1211 | int i; |
| 1212 | |
| 1213 | err = cpfl_txq_hairpin_info_update(dev, rx_port); |
| 1214 | if (err != 0) { |
| 1215 | PMD_DRV_LOG(ERR, "Fail to update Tx hairpin queue info."); |
| 1216 | return err; |
| 1217 | } |
| 1218 | |
| 1219 | /* configure hairpin queues */ |
| 1220 | for (i = cpfl_tx_vport->nb_data_txq; i < dev->data->nb_tx_queues; i++) { |
| 1221 | cpfl_txq = dev->data->tx_queues[i]; |
| 1222 | err = cpfl_hairpin_txq_config(tx_vport, cpfl_txq); |
| 1223 | if (err != 0) { |
| 1224 | PMD_DRV_LOG(ERR, "Fail to configure hairpin Tx queue %u", i); |
| 1225 | return err; |
| 1226 | } |
| 1227 | } |
| 1228 | |
| 1229 | err = cpfl_hairpin_tx_complq_config(cpfl_tx_vport); |
| 1230 | if (err != 0) { |
| 1231 | PMD_DRV_LOG(ERR, "Fail to config Tx completion queue"); |
| 1232 | return err; |
| 1233 | } |
| 1234 | |
| 1235 | peer_dev = &rte_eth_devices[rx_port]; |
| 1236 | cpfl_rx_vport = (struct cpfl_vport *)peer_dev->data->dev_private; |
| 1237 | rx_vport = &cpfl_rx_vport->base; |
| 1238 | cpfl_rxq_hairpin_mz_bind(peer_dev); |
| 1239 | |
| 1240 | err = cpfl_hairpin_rx_bufq_config(cpfl_rx_vport); |
| 1241 | if (err != 0) { |
| 1242 | PMD_DRV_LOG(ERR, "Fail to config Rx buffer queue"); |
| 1243 | return err; |
| 1244 | } |
| 1245 | |
| 1246 | for (i = cpfl_rx_vport->nb_data_rxq; i < peer_dev->data->nb_rx_queues; i++) { |
| 1247 | cpfl_rxq = peer_dev->data->rx_queues[i]; |
| 1248 | err = cpfl_hairpin_rxq_config(rx_vport, cpfl_rxq); |
| 1249 | if (err != 0) { |
| 1250 | PMD_DRV_LOG(ERR, "Fail to configure hairpin Rx queue %u", i); |
| 1251 | return err; |
| 1252 | } |
| 1253 | err = cpfl_rx_queue_init(peer_dev, i); |
| 1254 | if (err != 0) { |
| 1255 | PMD_DRV_LOG(ERR, "Fail to init hairpin Rx queue %u", i); |
| 1256 | return err; |
| 1257 | } |
nothing calls this directly
no test coverage detected