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

Function iavf_init_adminq

dpdk/drivers/common/iavf/iavf_adminq.c:516–558  ·  view source on GitHub ↗

* iavf_init_adminq - main initialization routine for Admin Queue * @hw: pointer to the hardware structure * * Prior to calling this function, drivers *MUST* set the following fields * in the hw->aq structure: * - hw->aq.num_asq_entries * - hw->aq.num_arq_entries * - hw->aq.arq_buf_size * - hw->aq.asq_buf_size **/

Source from the content-addressed store, hash-verified

514 * - hw->aq.asq_buf_size
515 **/
516enum iavf_status iavf_init_adminq(struct iavf_hw *hw)
517{
518 enum iavf_status ret_code;
519
520 /* verify input for valid configuration */
521 if ((hw->aq.num_arq_entries == 0) ||
522 (hw->aq.num_asq_entries == 0) ||
523 (hw->aq.arq_buf_size == 0) ||
524 (hw->aq.asq_buf_size == 0)) {
525 ret_code = IAVF_ERR_CONFIG;
526 goto init_adminq_exit;
527 }
528 iavf_init_spinlock(&hw->aq.asq_spinlock);
529 iavf_init_spinlock(&hw->aq.arq_spinlock);
530
531 /* Set up register offsets */
532 iavf_adminq_init_regs(hw);
533
534 /* setup ASQ command write back timeout */
535 hw->aq.asq_cmd_timeout = IAVF_ASQ_CMD_TIMEOUT;
536
537 /* allocate the ASQ */
538 ret_code = iavf_init_asq(hw);
539 if (ret_code != IAVF_SUCCESS)
540 goto init_adminq_destroy_spinlocks;
541
542 /* allocate the ARQ */
543 ret_code = iavf_init_arq(hw);
544 if (ret_code != IAVF_SUCCESS)
545 goto init_adminq_free_asq;
546
547 /* success! */
548 goto init_adminq_exit;
549
550init_adminq_free_asq:
551 iavf_shutdown_asq(hw);
552init_adminq_destroy_spinlocks:
553 iavf_destroy_spinlock(&hw->aq.asq_spinlock);
554 iavf_destroy_spinlock(&hw->aq.arq_spinlock);
555
556init_adminq_exit:
557 return ret_code;
558}
559
560/**
561 * iavf_shutdown_adminq - shutdown routine for the Admin Queue

Callers 2

iavf_init_vfFunction · 0.85
ice_dcf_init_hwFunction · 0.85

Calls 4

iavf_adminq_init_regsFunction · 0.85
iavf_init_asqFunction · 0.85
iavf_init_arqFunction · 0.85
iavf_shutdown_asqFunction · 0.85

Tested by

no test coverage detected