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

Function ark_config_device

dpdk/drivers/net/ark/ark_ethdev.c:482–530  ·  view source on GitHub ↗

*Initial device configuration when device is opened * setup the DDM, and UDM * Called once per PCIE device */

Source from the content-addressed store, hash-verified

480 * Called once per PCIE device
481 */
482static int
483ark_config_device(struct rte_eth_dev *dev)
484{
485 struct ark_adapter *ark = dev->data->dev_private;
486 uint16_t num_q, i;
487 struct ark_mpu_t *mpu;
488
489 /*
490 * Make sure that the packet director, generator and checker are in a
491 * known state
492 */
493 if (!ark->isvf) {
494 ark->start_pg = 0;
495 ark->pg_running = 0;
496 ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
497 if (ark->pg == NULL)
498 return -1;
499 ark_pktgen_reset(ark->pg);
500 ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
501 if (ark->pc == NULL)
502 return -1;
503 ark_pktchkr_stop(ark->pc);
504 ark->pd = ark_pktdir_init(ark->pktdir.v);
505 if (ark->pd == NULL)
506 return -1;
507 }
508 /* Verify HW */
509 if (ark_udm_verify(ark->udm.v))
510 return -1;
511 if (ark_ddm_verify(ark->ddm.v))
512 return -1;
513
514 /* MPU reset */
515 mpu = ark->mpurx.v;
516 num_q = ark_api_num_queues(mpu);
517 ark->rx_queues = num_q;
518 for (i = 0; i < num_q; i++) {
519 mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
520 }
521
522 mpu = ark->mputx.v;
523 num_q = ark_api_num_queues(mpu);
524 ark->tx_queues = num_q;
525 for (i = 0; i < num_q; i++) {
526 mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
527 }
528
529 return 0;
530}
531
532static int
533eth_ark_dev_uninit(struct rte_eth_dev *dev)

Callers 1

eth_ark_dev_initFunction · 0.85

Calls 8

ark_pktgen_initFunction · 0.85
ark_pktgen_resetFunction · 0.85
ark_pktchkr_initFunction · 0.85
ark_pktchkr_stopFunction · 0.85
ark_pktdir_initFunction · 0.85
ark_udm_verifyFunction · 0.85
ark_ddm_verifyFunction · 0.85
ark_api_num_queuesFunction · 0.85

Tested by

no test coverage detected