| 1296 | } |
| 1297 | |
| 1298 | static int |
| 1299 | octeontx_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, |
| 1300 | uint16_t nb_desc, unsigned int socket_id, |
| 1301 | const struct rte_eth_rxconf *rx_conf, |
| 1302 | struct rte_mempool *mb_pool) |
| 1303 | { |
| 1304 | struct octeontx_nic *nic = octeontx_pmd_priv(dev); |
| 1305 | struct rte_mempool_ops *mp_ops = NULL; |
| 1306 | struct octeontx_rxq *rxq = NULL; |
| 1307 | pki_pktbuf_cfg_t pktbuf_conf; |
| 1308 | pki_hash_cfg_t pki_hash; |
| 1309 | pki_qos_cfg_t pki_qos; |
| 1310 | uintptr_t pool; |
| 1311 | int ret, port; |
| 1312 | uint16_t gaura; |
| 1313 | unsigned int ev_queues = (nic->ev_queues * nic->port_id) + qidx; |
| 1314 | unsigned int ev_ports = (nic->ev_ports * nic->port_id) + qidx; |
| 1315 | |
| 1316 | RTE_SET_USED(nb_desc); |
| 1317 | |
| 1318 | memset(&pktbuf_conf, 0, sizeof(pktbuf_conf)); |
| 1319 | memset(&pki_hash, 0, sizeof(pki_hash)); |
| 1320 | memset(&pki_qos, 0, sizeof(pki_qos)); |
| 1321 | |
| 1322 | mp_ops = rte_mempool_get_ops(mb_pool->ops_index); |
| 1323 | if (strcmp(mp_ops->name, "octeontx_fpavf")) { |
| 1324 | octeontx_log_err("failed to find octeontx_fpavf mempool"); |
| 1325 | return -ENOTSUP; |
| 1326 | } |
| 1327 | |
| 1328 | /* Handle forbidden configurations */ |
| 1329 | if (nic->pki.classifier_enable) { |
| 1330 | octeontx_log_err("cannot setup queue %d. " |
| 1331 | "Classifier option unsupported", qidx); |
| 1332 | return -EINVAL; |
| 1333 | } |
| 1334 | |
| 1335 | port = nic->port_id; |
| 1336 | |
| 1337 | /* Rx deferred start is not supported */ |
| 1338 | if (rx_conf->rx_deferred_start) { |
| 1339 | octeontx_log_err("rx deferred start not supported"); |
| 1340 | return -EINVAL; |
| 1341 | } |
| 1342 | |
| 1343 | /* Verify queue index */ |
| 1344 | if (qidx >= dev->data->nb_rx_queues) { |
| 1345 | octeontx_log_err("QID %d not supported (0 - %d available)", |
| 1346 | qidx, (dev->data->nb_rx_queues - 1)); |
| 1347 | return -ENOTSUP; |
| 1348 | } |
| 1349 | |
| 1350 | /* Socket id check */ |
| 1351 | if (socket_id != (unsigned int)SOCKET_ID_ANY && |
| 1352 | socket_id != (unsigned int)nic->node) |
| 1353 | PMD_RX_LOG(INFO, "socket_id expected %d, configured %d", |
| 1354 | socket_id, nic->node); |
| 1355 |
nothing calls this directly
no test coverage detected