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

Function ice_dcf_init_hw

dpdk/drivers/net/ice/ice_dcf.c:738–871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

736}
737
738int
739ice_dcf_init_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)
740{
741 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
742 int ret, size;
743
744 hw->resetting = false;
745
746 hw->avf.hw_addr = pci_dev->mem_resource[0].addr;
747 hw->avf.back = hw;
748
749 hw->avf.bus.bus_id = pci_dev->addr.bus;
750 hw->avf.bus.device = pci_dev->addr.devid;
751 hw->avf.bus.func = pci_dev->addr.function;
752
753 hw->avf.device_id = pci_dev->id.device_id;
754 hw->avf.vendor_id = pci_dev->id.vendor_id;
755 hw->avf.subsystem_device_id = pci_dev->id.subsystem_device_id;
756 hw->avf.subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
757
758 hw->avf.aq.num_arq_entries = ICE_DCF_AQ_LEN;
759 hw->avf.aq.num_asq_entries = ICE_DCF_AQ_LEN;
760 hw->avf.aq.arq_buf_size = ICE_DCF_AQ_BUF_SZ;
761 hw->avf.aq.asq_buf_size = ICE_DCF_AQ_BUF_SZ;
762
763 rte_spinlock_init(&hw->vc_cmd_send_lock);
764 rte_spinlock_init(&hw->vc_cmd_queue_lock);
765 TAILQ_INIT(&hw->vc_cmd_queue);
766
767 __atomic_store_n(&hw->vsi_update_thread_num, 0, __ATOMIC_RELAXED);
768
769 hw->arq_buf = rte_zmalloc("arq_buf", ICE_DCF_AQ_BUF_SZ, 0);
770 if (hw->arq_buf == NULL) {
771 PMD_INIT_LOG(ERR, "unable to allocate AdminQ buffer memory");
772 goto err;
773 }
774
775 ret = iavf_set_mac_type(&hw->avf);
776 if (ret) {
777 PMD_INIT_LOG(ERR, "set_mac_type failed: %d", ret);
778 goto err;
779 }
780
781 ret = ice_dcf_check_reset_done(hw);
782 if (ret) {
783 PMD_INIT_LOG(ERR, "VF is still resetting");
784 goto err;
785 }
786
787 ret = iavf_init_adminq(&hw->avf);
788 if (ret) {
789 PMD_INIT_LOG(ERR, "init_adminq failed: %d", ret);
790 goto err;
791 }
792
793 if (ice_dcf_init_check_api_version(hw)) {
794 PMD_INIT_LOG(ERR, "check_api version failed");
795 goto err_api;

Callers 2

ice_dcf_reset_hwFunction · 0.85
ice_dcf_dev_initFunction · 0.85

Calls 15

rte_spinlock_initFunction · 0.85
rte_zmallocFunction · 0.85
iavf_set_mac_typeFunction · 0.85
ice_dcf_check_reset_doneFunction · 0.85
iavf_init_adminqFunction · 0.85
ice_dcf_get_vf_resourceFunction · 0.85
ice_dcf_get_vf_vsi_mapFunction · 0.85
ice_dcf_mode_disableFunction · 0.85
ice_dcf_tm_conf_initFunction · 0.85
ice_dcf_enable_irq0Function · 0.85

Tested by

no test coverage detected