MCPcopy Create free account
hub / github.com/F-Stack/f-stack / octeontx_dev_rx_queue_setup

Function octeontx_dev_rx_queue_setup

dpdk/drivers/net/octeontx/octeontx_ethdev.c:1298–1461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1296}
1297
1298static int
1299octeontx_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

Callers

nothing calls this directly

Calls 12

octeontx_pmd_privFunction · 0.85
memsetFunction · 0.85
rte_mempool_get_opsFunction · 0.85
strcmpFunction · 0.85
rte_zmalloc_socketFunction · 0.85
rte_pktmbuf_priv_sizeFunction · 0.85
rte_freeFunction · 0.85

Tested by

no test coverage detected