Lines Matching refs:oct
71 static int octeon_device_init(struct octeon_device *oct);
74 static int lio_wait_for_oq_pkts(struct octeon_device *oct) in lio_wait_for_oq_pkts() argument
77 (struct octeon_device_priv *)oct->priv; in lio_wait_for_oq_pkts()
85 for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES(oct); i++) { in lio_wait_for_oq_pkts()
86 if (!(oct->io_qmask.oq & BIT_ULL(i))) in lio_wait_for_oq_pkts()
88 pkt_cnt += octeon_droq_check_hw_for_pkts(oct->droq[i]); in lio_wait_for_oq_pkts()
106 static void pcierror_quiesce_device(struct octeon_device *oct) in pcierror_quiesce_device() argument
118 if (wait_for_pending_requests(oct)) in pcierror_quiesce_device()
119 dev_err(&oct->pci_dev->dev, "There were pending requests\n"); in pcierror_quiesce_device()
122 for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { in pcierror_quiesce_device()
125 if (!(oct->io_qmask.iq & BIT_ULL(i))) in pcierror_quiesce_device()
127 iq = oct->instr_queue[i]; in pcierror_quiesce_device()
135 lio_process_iq_request_list(oct, iq, 0); in pcierror_quiesce_device()
141 lio_process_ordered_list(oct, 1); in pcierror_quiesce_device()
170 static void stop_pci_io(struct octeon_device *oct) in stop_pci_io() argument
176 atomic_set(&oct->status, OCT_DEV_IN_RESET); in stop_pci_io()
178 for (i = 0; i < oct->ifcount; i++) in stop_pci_io()
179 netif_device_detach(oct->props[i].netdev); in stop_pci_io()
182 oct->fn_list.disable_interrupt(oct, OCTEON_ALL_INTR); in stop_pci_io()
184 pcierror_quiesce_device(oct); in stop_pci_io()
185 if (oct->msix_on) { in stop_pci_io()
186 msix_entries = (struct msix_entry *)oct->msix_entries; in stop_pci_io()
187 for (i = 0; i < oct->num_msix_irqs; i++) { in stop_pci_io()
192 &oct->ioq_vector[i]); in stop_pci_io()
194 pci_disable_msix(oct->pci_dev); in stop_pci_io()
195 kfree(oct->msix_entries); in stop_pci_io()
196 oct->msix_entries = NULL; in stop_pci_io()
197 octeon_free_ioq_vector(oct); in stop_pci_io()
199 dev_dbg(&oct->pci_dev->dev, "Device state is now %s\n", in stop_pci_io()
200 lio_get_state_string(&oct->status)); in stop_pci_io()
203 cleanup_aer_uncorrect_error_status(oct->pci_dev); in stop_pci_io()
205 pci_disable_device(oct->pci_dev); in stop_pci_io()
219 struct octeon_device *oct = pci_get_drvdata(pdev); in liquidio_pcie_error_detected() local
223 dev_err(&oct->pci_dev->dev, "Non-correctable non-fatal error reported:\n"); in liquidio_pcie_error_detected()
224 cleanup_aer_uncorrect_error_status(oct->pci_dev); in liquidio_pcie_error_detected()
229 dev_err(&oct->pci_dev->dev, "Non-correctable FATAL reported by PCI AER driver\n"); in liquidio_pcie_error_detected()
230 stop_pci_io(oct); in liquidio_pcie_error_detected()
306 struct octeon_device *oct = lio->oct_dev; in setup_link_status_change_wq() local
311 dev_err(&oct->pci_dev->dev, "unable to create cavium link status wq\n"); in setup_link_status_change_wq()
344 struct octeon_device *oct = lio->oct_dev; in update_link_status() local
361 dev_info(&oct->pci_dev->dev, in update_link_status()
368 dev_warn(&oct->pci_dev->dev, in update_link_status()
423 static void octeon_pci_flr(struct octeon_device *oct) in octeon_pci_flr() argument
425 pci_save_state(oct->pci_dev); in octeon_pci_flr()
427 pci_cfg_access_lock(oct->pci_dev); in octeon_pci_flr()
430 pci_write_config_word(oct->pci_dev, PCI_COMMAND, in octeon_pci_flr()
433 pcie_flr(oct->pci_dev); in octeon_pci_flr()
435 pci_cfg_access_unlock(oct->pci_dev); in octeon_pci_flr()
437 pci_restore_state(oct->pci_dev); in octeon_pci_flr()
445 static void octeon_destroy_resources(struct octeon_device *oct) in octeon_destroy_resources() argument
448 (struct octeon_device_priv *)oct->priv; in octeon_destroy_resources()
452 switch (atomic_read(&oct->status)) { in octeon_destroy_resources()
456 atomic_set(&oct->status, OCT_DEV_IN_RESET); in octeon_destroy_resources()
458 oct->app_mode = CVM_DRV_INVALID_APP; in octeon_destroy_resources()
459 dev_dbg(&oct->pci_dev->dev, "Device state is now %s\n", in octeon_destroy_resources()
460 lio_get_state_string(&oct->status)); in octeon_destroy_resources()
468 if (lio_wait_for_instr_fetch(oct)) in octeon_destroy_resources()
469 dev_err(&oct->pci_dev->dev, "IQ had pending instructions\n"); in octeon_destroy_resources()
471 if (wait_for_pending_requests(oct)) in octeon_destroy_resources()
472 dev_err(&oct->pci_dev->dev, "There were pending requests\n"); in octeon_destroy_resources()
478 oct->fn_list.disable_io_queues(oct); in octeon_destroy_resources()
480 if (lio_wait_for_oq_pkts(oct)) in octeon_destroy_resources()
481 dev_err(&oct->pci_dev->dev, "OQ had pending packets\n"); in octeon_destroy_resources()
486 for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { in octeon_destroy_resources()
489 if (!(oct->io_qmask.iq & BIT_ULL(i))) in octeon_destroy_resources()
491 iq = oct->instr_queue[i]; in octeon_destroy_resources()
499 lio_process_iq_request_list(oct, iq, 0); in octeon_destroy_resources()
504 lio_process_ordered_list(oct, 1); in octeon_destroy_resources()
505 octeon_free_sc_done_list(oct); in octeon_destroy_resources()
506 octeon_free_sc_zombie_list(oct); in octeon_destroy_resources()
511 oct->fn_list.disable_interrupt(oct, OCTEON_ALL_INTR); in octeon_destroy_resources()
513 if (oct->msix_on) { in octeon_destroy_resources()
514 msix_entries = (struct msix_entry *)oct->msix_entries; in octeon_destroy_resources()
515 for (i = 0; i < oct->num_msix_irqs; i++) { in octeon_destroy_resources()
516 if (oct->ioq_vector[i].vector) { in octeon_destroy_resources()
521 &oct->ioq_vector[i]); in octeon_destroy_resources()
522 oct->ioq_vector[i].vector = 0; in octeon_destroy_resources()
525 pci_disable_msix(oct->pci_dev); in octeon_destroy_resources()
526 kfree(oct->msix_entries); in octeon_destroy_resources()
527 oct->msix_entries = NULL; in octeon_destroy_resources()
528 kfree(oct->irq_name_storage); in octeon_destroy_resources()
529 oct->irq_name_storage = NULL; in octeon_destroy_resources()
532 if (oct->pci_dev->reset_fn) in octeon_destroy_resources()
533 octeon_pci_flr(oct); in octeon_destroy_resources()
535 cn23xx_vf_ask_pf_to_do_flr(oct); in octeon_destroy_resources()
539 octeon_free_ioq_vector(oct); in octeon_destroy_resources()
543 oct->fn_list.free_mbox(oct); in octeon_destroy_resources()
549 for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES(oct); i++) { in octeon_destroy_resources()
550 if (!(oct->io_qmask.oq & BIT_ULL(i))) in octeon_destroy_resources()
552 octeon_delete_droq(oct, i); in octeon_destroy_resources()
557 octeon_delete_response_list(oct); in octeon_destroy_resources()
561 for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { in octeon_destroy_resources()
562 if (!(oct->io_qmask.iq & BIT_ULL(i))) in octeon_destroy_resources()
564 octeon_delete_instr_queue(oct, i); in octeon_destroy_resources()
569 octeon_free_sc_buffer_pool(oct); in octeon_destroy_resources()
573 octeon_delete_dispatch_list(oct); in octeon_destroy_resources()
574 cancel_delayed_work_sync(&oct->nic_poll_work.work); in octeon_destroy_resources()
578 octeon_unmap_pci_barx(oct, 0); in octeon_destroy_resources()
579 octeon_unmap_pci_barx(oct, 1); in octeon_destroy_resources()
583 pci_clear_master(oct->pci_dev); in octeon_destroy_resources()
585 pci_disable_device(oct->pci_dev); in octeon_destroy_resources()
603 struct octeon_device *oct = (struct octeon_device *)lio->oct_dev; in send_rx_ctrl_cmd() local
608 if (oct->props[lio->ifidx].rx_on == start_stop) in send_rx_ctrl_cmd()
612 octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE, in send_rx_ctrl_cmd()
625 octeon_prepare_soft_command(oct, sc, OPCODE_NIC, in send_rx_ctrl_cmd()
631 retval = octeon_send_soft_command(oct, sc); in send_rx_ctrl_cmd()
634 octeon_free_soft_command(oct, sc); in send_rx_ctrl_cmd()
639 retval = wait_for_sc_completion_timeout(oct, sc, 0); in send_rx_ctrl_cmd()
643 oct->props[lio->ifidx].rx_on = start_stop; in send_rx_ctrl_cmd()
656 static void liquidio_destroy_nic_device(struct octeon_device *oct, int ifidx) in liquidio_destroy_nic_device() argument
658 struct net_device *netdev = oct->props[ifidx].netdev; in liquidio_destroy_nic_device()
660 (struct octeon_device_priv *)oct->priv; in liquidio_destroy_nic_device()
665 dev_err(&oct->pci_dev->dev, "%s No netdevice ptr for index %d\n", in liquidio_destroy_nic_device()
672 dev_dbg(&oct->pci_dev->dev, "NIC device cleanup\n"); in liquidio_destroy_nic_device()
677 if (oct->props[lio->ifidx].napi_enabled == 1) { in liquidio_destroy_nic_device()
681 oct->props[lio->ifidx].napi_enabled = 0; in liquidio_destroy_nic_device()
683 oct->droq[0]->ops.poll_mode = 0; in liquidio_destroy_nic_device()
703 oct->props[ifidx].gmxport = -1; in liquidio_destroy_nic_device()
705 oct->props[ifidx].netdev = NULL; in liquidio_destroy_nic_device()
712 static int liquidio_stop_nic_module(struct octeon_device *oct) in liquidio_stop_nic_module() argument
717 dev_dbg(&oct->pci_dev->dev, "Stopping network interfaces\n"); in liquidio_stop_nic_module()
718 if (!oct->ifcount) { in liquidio_stop_nic_module()
719 dev_err(&oct->pci_dev->dev, "Init for Octeon was not completed\n"); in liquidio_stop_nic_module()
723 spin_lock_bh(&oct->cmd_resp_wqlock); in liquidio_stop_nic_module()
724 oct->cmd_resp_state = OCT_DRV_OFFLINE; in liquidio_stop_nic_module()
725 spin_unlock_bh(&oct->cmd_resp_wqlock); in liquidio_stop_nic_module()
727 for (i = 0; i < oct->ifcount; i++) { in liquidio_stop_nic_module()
728 lio = GET_LIO(oct->props[i].netdev); in liquidio_stop_nic_module()
729 for (j = 0; j < oct->num_oqs; j++) in liquidio_stop_nic_module()
730 octeon_unregister_droq_ops(oct, in liquidio_stop_nic_module()
734 for (i = 0; i < oct->ifcount; i++) in liquidio_stop_nic_module()
735 liquidio_destroy_nic_device(oct, i); in liquidio_stop_nic_module()
737 dev_dbg(&oct->pci_dev->dev, "Network interfaces stopped\n"); in liquidio_stop_nic_module()
771 static int octeon_pci_os_setup(struct octeon_device *oct) in octeon_pci_os_setup() argument
775 if (!oct->pci_dev->physfn) in octeon_pci_os_setup()
776 octeon_pci_flr(oct); in octeon_pci_os_setup()
779 if (pci_enable_device(oct->pci_dev)) { in octeon_pci_os_setup()
780 dev_err(&oct->pci_dev->dev, "pci_enable_device failed\n"); in octeon_pci_os_setup()
784 if (dma_set_mask_and_coherent(&oct->pci_dev->dev, DMA_BIT_MASK(64))) { in octeon_pci_os_setup()
785 dev_err(&oct->pci_dev->dev, "Unexpected DMA device capability\n"); in octeon_pci_os_setup()
786 pci_disable_device(oct->pci_dev); in octeon_pci_os_setup()
791 pci_set_master(oct->pci_dev); in octeon_pci_os_setup()
908 struct octeon_device *oct = lio->oct_dev; in liquidio_open() local
910 (struct octeon_device_priv *)oct->priv; in liquidio_open()
913 if (!oct->props[lio->ifidx].napi_enabled) { in liquidio_open()
919 oct->props[lio->ifidx].napi_enabled = 1; in liquidio_open()
921 oct->droq[0]->ops.poll_mode = 1; in liquidio_open()
940 dev_info(&oct->pci_dev->dev, "%s interface is opened\n", netdev->name); in liquidio_open()
952 struct octeon_device *oct = lio->oct_dev; in liquidio_stop() local
954 (struct octeon_device_priv *)oct->priv; in liquidio_stop()
973 if (lio_wait_for_clean_oq(oct)) in liquidio_stop()
977 if (oct->props[lio->ifidx].napi_enabled == 1) { in liquidio_stop()
981 oct->props[lio->ifidx].napi_enabled = 0; in liquidio_stop()
983 oct->droq[0]->ops.poll_mode = 0; in liquidio_stop()
990 dev_info(&oct->pci_dev->dev, "%s interface is stopped\n", netdev->name); in liquidio_stop()
1031 struct octeon_device *oct = lio->oct_dev; in liquidio_set_uc_list() local
1040 dev_err(&oct->pci_dev->dev, "too many MAC addresses in netdev uc list\n"); in liquidio_set_uc_list()
1049 nctrl.ncmd.s.param1 = oct->vf_num; in liquidio_set_uc_list()
1072 struct octeon_device *oct = lio->oct_dev; in liquidio_set_mcast_list() local
1107 dev_err(&oct->pci_dev->dev, "DEVFLAGS change failed in core (ret: 0x%x)\n", in liquidio_set_mcast_list()
1122 struct octeon_device *oct = lio->oct_dev; in liquidio_set_mac() local
1150 dev_err(&oct->pci_dev->dev, "MAC Address change failed\n"); in liquidio_set_mac()
1156 dev_err(&oct->pci_dev->dev, "MAC Address change failed: no permission\n"); in liquidio_set_mac()
1171 struct octeon_device *oct; in liquidio_get_stats64() local
1177 oct = lio->oct_dev; in liquidio_get_stats64()
1182 for (i = 0; i < oct->num_iqs; i++) { in liquidio_get_stats64()
1184 iq_stats = &oct->instr_queue[iq_no]->stats; in liquidio_get_stats64()
1198 for (i = 0; i < oct->num_oqs; i++) { in liquidio_get_stats64()
1200 oq_stats = &oct->droq[oq_no]->stats; in liquidio_get_stats64()
1213 lstats->multicast = oct->link_stats.fromwire.fw_total_mcast; in liquidio_get_stats64()
1216 lstats->rx_length_errors = oct->link_stats.fromwire.l2_err; in liquidio_get_stats64()
1218 lstats->rx_crc_errors = oct->link_stats.fromwire.fcs_err; in liquidio_get_stats64()
1220 lstats->rx_frame_errors = oct->link_stats.fromwire.frame_err; in liquidio_get_stats64()
1226 lstats->tx_aborted_errors = oct->link_stats.fromhost.fw_err_pko; in liquidio_get_stats64()
1227 lstats->tx_carrier_errors = oct->link_stats.fromhost.fw_err_link; in liquidio_get_stats64()
1307 static void handle_timestamp(struct octeon_device *oct, u32 status, void *buf) in handle_timestamp() argument
1318 oct = lio->oct_dev; in handle_timestamp()
1322 dev_err(&oct->pci_dev->dev, "Tx timestamp instruction failed. Status: %llx\n", in handle_timestamp()
1340 octeon_free_soft_command(oct, sc); in handle_timestamp()
1349 static int send_nic_timestamp_pkt(struct octeon_device *oct, in send_nic_timestamp_pkt() argument
1362 sc = octeon_alloc_soft_command_resp(oct, &ndata->cmd, in send_nic_timestamp_pkt()
1367 dev_err(&oct->pci_dev->dev, "No memory for timestamped data packet\n"); in send_nic_timestamp_pkt()
1384 retval = octeon_send_command(oct, sc->iq_no, ring_doorbell, &sc->cmd, in send_nic_timestamp_pkt()
1388 dev_err(&oct->pci_dev->dev, "timestamp data packet failed status: %x\n", in send_nic_timestamp_pkt()
1390 octeon_free_soft_command(oct, sc); in send_nic_timestamp_pkt()
1411 struct octeon_device *oct; in liquidio_xmit() local
1422 oct = lio->oct_dev; in liquidio_xmit()
1428 stats = &oct->instr_queue[iq_no]->stats; in liquidio_xmit()
1455 if (octnet_iq_is_full(oct, ndata.q_no)) { in liquidio_xmit()
1483 octnet_prepare_pci_cmd(oct, &ndata.cmd, &cmdsetup, tag); in liquidio_xmit()
1485 dptr = dma_map_single(&oct->pci_dev->dev, in liquidio_xmit()
1489 if (dma_mapping_error(&oct->pci_dev->dev, dptr)) { in liquidio_xmit()
1490 dev_err(&oct->pci_dev->dev, "%s DMA mapping error 1\n", in liquidio_xmit()
1517 octnet_prepare_pci_cmd(oct, &ndata.cmd, &cmdsetup, tag); in liquidio_xmit()
1521 g->sg[0].ptr[0] = dma_map_single(&oct->pci_dev->dev, in liquidio_xmit()
1525 if (dma_mapping_error(&oct->pci_dev->dev, g->sg[0].ptr[0])) { in liquidio_xmit()
1526 dev_err(&oct->pci_dev->dev, "%s DMA mapping error 2\n", in liquidio_xmit()
1538 skb_frag_dma_map(&oct->pci_dev->dev, in liquidio_xmit()
1541 if (dma_mapping_error(&oct->pci_dev->dev, in liquidio_xmit()
1543 dma_unmap_single(&oct->pci_dev->dev, in liquidio_xmit()
1549 dma_unmap_page(&oct->pci_dev->dev, in liquidio_xmit()
1554 dev_err(&oct->pci_dev->dev, "%s DMA mapping error 3\n", in liquidio_xmit()
1590 status = send_nic_timestamp_pkt(oct, &ndata, finfo, xmit_more); in liquidio_xmit()
1592 status = octnet_send_nic_data_pkt(oct, &ndata, xmit_more); in liquidio_xmit()
1599 dev_err(&oct->pci_dev->dev, "Rcvd IQ_SEND_STOP signal; stopping IQ-%d\n", in liquidio_xmit()
1619 dma_unmap_single(&oct->pci_dev->dev, dptr, in liquidio_xmit()
1622 octeon_ring_doorbell_locked(oct, iq_no); in liquidio_xmit()
1649 struct octeon_device *oct = lio->oct_dev; in liquidio_vlan_rx_add_vid() local
1664 dev_err(&oct->pci_dev->dev, "Add VLAN filter failed in core (ret: 0x%x)\n", in liquidio_vlan_rx_add_vid()
1677 struct octeon_device *oct = lio->oct_dev; in liquidio_vlan_rx_kill_vid() local
1692 dev_err(&oct->pci_dev->dev, "Del VLAN filter failed in core (ret: 0x%x)\n", in liquidio_vlan_rx_kill_vid()
1711 struct octeon_device *oct = lio->oct_dev; in liquidio_set_rxcsum_command() local
1726 dev_err(&oct->pci_dev->dev, "DEVFLAGS RXCSUM change failed in core (ret:0x%x)\n", in liquidio_set_rxcsum_command()
1746 struct octeon_device *oct = lio->oct_dev; in liquidio_vxlan_port_command() local
1762 dev_err(&oct->pci_dev->dev, in liquidio_vxlan_port_command()
1883 struct octeon_device *oct = (struct octeon_device *)buf; in lio_nic_info() local
1890 dev_err(&oct->pci_dev->dev, "Malformed NIC_INFO, len=%d, ifidx=%d\n", in lio_nic_info()
1902 for (i = 0; i < oct->ifcount; i++) { in lio_nic_info()
1903 if (oct->props[i].gmxport == gmxport) { in lio_nic_info()
1904 update_link_status(oct->props[i].netdev, ls); in lio_nic_info()
2233 static int liquidio_init_nic_module(struct octeon_device *oct) in liquidio_init_nic_module() argument
2238 dev_dbg(&oct->pci_dev->dev, "Initializing network interfaces\n"); in liquidio_init_nic_module()
2243 oct->ifcount = num_nic_ports; in liquidio_init_nic_module()
2244 memset(oct->props, 0, in liquidio_init_nic_module()
2248 oct->props[i].gmxport = -1; in liquidio_init_nic_module()
2250 retval = setup_nic_devices(oct); in liquidio_init_nic_module()
2252 dev_err(&oct->pci_dev->dev, "Setup NIC devices failed\n"); in liquidio_init_nic_module()
2256 dev_dbg(&oct->pci_dev->dev, "Network interfaces ready\n"); in liquidio_init_nic_module()
2262 oct->ifcount = 0; in liquidio_init_nic_module()
2271 static int octeon_device_init(struct octeon_device *oct) in octeon_device_init() argument
2276 atomic_set(&oct->status, OCT_DEV_BEGIN_STATE); in octeon_device_init()
2281 if (octeon_pci_os_setup(oct)) in octeon_device_init()
2283 atomic_set(&oct->status, OCT_DEV_PCI_ENABLE_DONE); in octeon_device_init()
2285 oct->chip_id = OCTEON_CN23XX_VF_VID; in octeon_device_init()
2286 pci_read_config_dword(oct->pci_dev, 8, &rev_id); in octeon_device_init()
2287 oct->rev_id = rev_id & 0xff; in octeon_device_init()
2289 if (cn23xx_setup_octeon_vf_device(oct)) in octeon_device_init()
2292 atomic_set(&oct->status, OCT_DEV_PCI_MAP_DONE); in octeon_device_init()
2294 oct->app_mode = CVM_DRV_NIC_APP; in octeon_device_init()
2299 if (octeon_init_dispatch_list(oct)) in octeon_device_init()
2302 atomic_set(&oct->status, OCT_DEV_DISPATCH_INIT_DONE); in octeon_device_init()
2304 if (octeon_set_io_queues_off(oct)) { in octeon_device_init()
2305 dev_err(&oct->pci_dev->dev, "setting io queues off failed\n"); in octeon_device_init()
2309 if (oct->fn_list.setup_device_regs(oct)) { in octeon_device_init()
2310 dev_err(&oct->pci_dev->dev, "device registers configuration failed\n"); in octeon_device_init()
2315 if (octeon_setup_sc_buffer_pool(oct)) { in octeon_device_init()
2316 dev_err(&oct->pci_dev->dev, "sc buffer pool allocation failed\n"); in octeon_device_init()
2319 atomic_set(&oct->status, OCT_DEV_SC_BUFF_POOL_INIT_DONE); in octeon_device_init()
2322 if (octeon_setup_instr_queues(oct)) { in octeon_device_init()
2323 dev_err(&oct->pci_dev->dev, "instruction queue initialization failed\n"); in octeon_device_init()
2326 atomic_set(&oct->status, OCT_DEV_INSTR_QUEUE_INIT_DONE); in octeon_device_init()
2331 if (octeon_setup_response_list(oct)) { in octeon_device_init()
2332 dev_err(&oct->pci_dev->dev, "Response list allocation failed\n"); in octeon_device_init()
2335 atomic_set(&oct->status, OCT_DEV_RESP_LIST_INIT_DONE); in octeon_device_init()
2337 if (octeon_setup_output_queues(oct)) { in octeon_device_init()
2338 dev_err(&oct->pci_dev->dev, "Output queue initialization failed\n"); in octeon_device_init()
2341 atomic_set(&oct->status, OCT_DEV_DROQ_INIT_DONE); in octeon_device_init()
2343 if (oct->fn_list.setup_mbox(oct)) { in octeon_device_init()
2344 dev_err(&oct->pci_dev->dev, "Mailbox setup failed\n"); in octeon_device_init()
2347 atomic_set(&oct->status, OCT_DEV_MBOX_SETUP_DONE); in octeon_device_init()
2349 if (octeon_allocate_ioq_vector(oct, oct->sriov_info.rings_per_vf)) { in octeon_device_init()
2350 dev_err(&oct->pci_dev->dev, "ioq vector allocation failed\n"); in octeon_device_init()
2353 atomic_set(&oct->status, OCT_DEV_MSIX_ALLOC_VECTOR_DONE); in octeon_device_init()
2355 dev_info(&oct->pci_dev->dev, "OCTEON_CN23XX VF Version: %s, %d ioqs\n", in octeon_device_init()
2356 LIQUIDIO_VERSION, oct->sriov_info.rings_per_vf); in octeon_device_init()
2359 if (octeon_setup_interrupt(oct, oct->sriov_info.rings_per_vf)) in octeon_device_init()
2362 atomic_set(&oct->status, OCT_DEV_INTR_SET_DONE); in octeon_device_init()
2372 oct->fn_list.enable_interrupt(oct, OCTEON_ALL_INTR); in octeon_device_init()
2374 if (cn23xx_octeon_pfvf_handshake(oct)) in octeon_device_init()
2382 oct->fn_list.enable_interrupt(oct, OCTEON_ALL_INTR); in octeon_device_init()
2386 if (oct->fn_list.enable_io_queues(oct)) { in octeon_device_init()
2387 dev_err(&oct->pci_dev->dev, "enabling io queues failed\n"); in octeon_device_init()
2391 atomic_set(&oct->status, OCT_DEV_IO_QUEUES_DONE); in octeon_device_init()
2393 atomic_set(&oct->status, OCT_DEV_HOST_OK); in octeon_device_init()
2398 for (j = 0; j < oct->num_oqs; j++) in octeon_device_init()
2399 writel(oct->droq[j]->max_count, oct->droq[j]->pkts_credit_reg); in octeon_device_init()
2403 atomic_set(&oct->status, OCT_DEV_CORE_OK); in octeon_device_init()
2405 atomic_set(&oct->status, OCT_DEV_RUNNING); in octeon_device_init()
2407 if (liquidio_init_nic_module(oct)) in octeon_device_init()