Lines Matching refs:oct
140 octeon_droq_destroy_ring_buffers(struct octeon_device *oct, in octeon_droq_destroy_ring_buffers() argument
152 lio_unmap_ring(oct->pci_dev, in octeon_droq_destroy_ring_buffers()
167 octeon_droq_setup_ring_buffers(struct octeon_device *oct, in octeon_droq_setup_ring_buffers() argument
175 buf = recv_buffer_alloc(oct, &droq->recv_buf_list[i].pg_info); in octeon_droq_setup_ring_buffers()
178 dev_err(&oct->pci_dev->dev, "%s buffer alloc failed\n", in octeon_droq_setup_ring_buffers()
198 int octeon_delete_droq(struct octeon_device *oct, u32 q_no) in octeon_delete_droq() argument
200 struct octeon_droq *droq = oct->droq[q_no]; in octeon_delete_droq()
202 dev_dbg(&oct->pci_dev->dev, "%s[%d]\n", __func__, q_no); in octeon_delete_droq()
204 octeon_droq_destroy_ring_buffers(oct, droq); in octeon_delete_droq()
208 lio_dma_free(oct, (droq->max_count * OCT_DROQ_DESC_SIZE), in octeon_delete_droq()
212 oct->io_qmask.oq &= ~(1ULL << q_no); in octeon_delete_droq()
213 vfree(oct->droq[q_no]); in octeon_delete_droq()
214 oct->droq[q_no] = NULL; in octeon_delete_droq()
215 oct->num_oqs--; in octeon_delete_droq()
220 int octeon_init_droq(struct octeon_device *oct, in octeon_init_droq() argument
229 int numa_node = dev_to_node(&oct->pci_dev->dev); in octeon_init_droq()
231 dev_dbg(&oct->pci_dev->dev, "%s[%d]\n", __func__, q_no); in octeon_init_droq()
233 droq = oct->droq[q_no]; in octeon_init_droq()
236 droq->oct_dev = oct; in octeon_init_droq()
245 if (OCTEON_CN6XXX(oct)) { in octeon_init_droq()
246 struct octeon_config *conf6x = CHIP_CONF(oct, cn6xxx); in octeon_init_droq()
251 } else if (OCTEON_CN23XX_PF(oct)) { in octeon_init_droq()
252 struct octeon_config *conf23 = CHIP_CONF(oct, cn23xx_pf); in octeon_init_droq()
256 } else if (OCTEON_CN23XX_VF(oct)) { in octeon_init_droq()
257 struct octeon_config *conf23 = CHIP_CONF(oct, cn23xx_vf); in octeon_init_droq()
269 droq->desc_ring = lio_dma_alloc(oct, desc_ring_size, in octeon_init_droq()
273 dev_err(&oct->pci_dev->dev, in octeon_init_droq()
278 dev_dbg(&oct->pci_dev->dev, "droq[%d]: desc_ring: virt: 0x%p, dma: %lx\n", in octeon_init_droq()
280 dev_dbg(&oct->pci_dev->dev, "droq[%d]: num_desc: %d\n", q_no, in octeon_init_droq()
291 dev_err(&oct->pci_dev->dev, "Output queue recv buf list alloc failed\n"); in octeon_init_droq()
295 if (octeon_droq_setup_ring_buffers(oct, droq)) in octeon_init_droq()
301 dev_dbg(&oct->pci_dev->dev, "DROQ INIT: max_empty_descs: %d\n", in octeon_init_droq()
307 oct->fn_list.setup_oq_regs(oct, q_no); in octeon_init_droq()
309 oct->io_qmask.oq |= BIT_ULL(q_no); in octeon_init_droq()
314 octeon_delete_droq(oct, q_no); in octeon_init_droq()
503 struct octeon_device *oct = droq->oct_dev; in octeon_retry_droq_refill() local
508 desc_refilled = octeon_droq_refill(oct, droq); in octeon_retry_droq_refill()
531 octeon_droq_dispatch_pkt(struct octeon_device *oct, in octeon_droq_dispatch_pkt() argument
542 disp_fn = octeon_get_dispatch(oct, (u16)rh->r.opcode, in octeon_droq_dispatch_pkt()
545 rinfo = octeon_create_recv_info(oct, droq, cnt, droq->read_idx); in octeon_droq_dispatch_pkt()
558 dev_err(&oct->pci_dev->dev, "DROQ: No dispatch function (opcode %u/%u)\n", in octeon_droq_dispatch_pkt()
567 static inline void octeon_droq_drop_packets(struct octeon_device *oct, in octeon_droq_drop_packets() argument
585 dev_err(&oct->pci_dev->dev, "DROQ: In drop: pkt with len 0\n"); in octeon_droq_drop_packets()
596 octeon_droq_fast_process_packets(struct octeon_device *oct, in octeon_droq_fast_process_packets() argument
617 dev_err(&oct->pci_dev->dev, in octeon_droq_fast_process_packets()
635 buf_cnt = octeon_droq_dispatch_pkt(oct, droq, rh, info); in octeon_droq_fast_process_packets()
646 if (recv_buffer_recycle(oct, pg_info)) in octeon_droq_fast_process_packets()
693 droq->ops.fptr(oct->octeon_id, in octeon_droq_fast_process_packets()
704 int desc_refilled = octeon_droq_refill(oct, droq); in octeon_droq_fast_process_packets()
723 octeon_droq_drop_packets(oct, droq, (pkts_to_process - pkt)); in octeon_droq_fast_process_packets()
737 octeon_schedule_rxq_oom_work(oct, droq); in octeon_droq_fast_process_packets()
744 octeon_droq_process_packets(struct octeon_device *oct, in octeon_droq_process_packets() argument
760 octeon_droq_fast_process_packets(oct, droq, pkt_count); in octeon_droq_process_packets()
768 (oct, in octeon_droq_process_packets()
786 octeon_droq_process_poll_pkts(struct octeon_device *oct, in octeon_droq_process_poll_pkts() argument
806 octeon_droq_fast_process_packets(oct, droq, in octeon_droq_process_poll_pkts()
818 (oct, in octeon_droq_process_poll_pkts()
828 octeon_enable_irq(struct octeon_device *oct, u32 q_no) in octeon_enable_irq() argument
830 switch (oct->chip_id) { in octeon_enable_irq()
834 (struct octeon_cn6xxx *)oct->chip; in octeon_enable_irq()
840 value = octeon_read_csr(oct, CN6XXX_SLI_PKT_TIME_INT_ENB); in octeon_enable_irq()
842 octeon_write_csr(oct, CN6XXX_SLI_PKT_TIME_INT_ENB, value); in octeon_enable_irq()
843 value = octeon_read_csr(oct, CN6XXX_SLI_PKT_CNT_INT_ENB); in octeon_enable_irq()
845 octeon_write_csr(oct, CN6XXX_SLI_PKT_CNT_INT_ENB, value); in octeon_enable_irq()
854 lio_enable_irq(oct->droq[q_no], oct->instr_queue[q_no]); in octeon_enable_irq()
858 lio_enable_irq(oct->droq[q_no], oct->instr_queue[q_no]); in octeon_enable_irq()
861 dev_err(&oct->pci_dev->dev, "%s Unknown Chip\n", __func__); in octeon_enable_irq()
868 int octeon_register_droq_ops(struct octeon_device *oct, u32 q_no, in octeon_register_droq_ops() argument
874 oct_cfg = octeon_get_conf(oct); in octeon_register_droq_ops()
880 dev_err(&oct->pci_dev->dev, "%s: droq_ops pointer is NULL\n", in octeon_register_droq_ops()
886 dev_err(&oct->pci_dev->dev, "%s: droq id (%d) exceeds MAX (%d)\n", in octeon_register_droq_ops()
887 __func__, q_no, (oct->num_oqs - 1)); in octeon_register_droq_ops()
891 droq = oct->droq[q_no]; in octeon_register_droq_ops()
897 int octeon_unregister_droq_ops(struct octeon_device *oct, u32 q_no) in octeon_unregister_droq_ops() argument
902 oct_cfg = octeon_get_conf(oct); in octeon_unregister_droq_ops()
908 dev_err(&oct->pci_dev->dev, "%s: droq id (%d) exceeds MAX (%d)\n", in octeon_unregister_droq_ops()
909 __func__, q_no, oct->num_oqs - 1); in octeon_unregister_droq_ops()
913 droq = oct->droq[q_no]; in octeon_unregister_droq_ops()
916 dev_info(&oct->pci_dev->dev, in octeon_unregister_droq_ops()
928 int octeon_create_droq(struct octeon_device *oct, in octeon_create_droq() argument
933 int numa_node = dev_to_node(&oct->pci_dev->dev); in octeon_create_droq()
935 if (oct->droq[q_no]) { in octeon_create_droq()
936 dev_dbg(&oct->pci_dev->dev, "Droq already in use. Cannot create droq %d again\n", in octeon_create_droq()
951 octeon_set_droq_pkt_op(oct, q_no, 0); in octeon_create_droq()
952 oct->droq[q_no] = droq; in octeon_create_droq()
955 if (octeon_init_droq(oct, q_no, num_descs, desc_size, app_ctx)) { in octeon_create_droq()
956 vfree(oct->droq[q_no]); in octeon_create_droq()
957 oct->droq[q_no] = NULL; in octeon_create_droq()
961 oct->num_oqs++; in octeon_create_droq()
963 dev_dbg(&oct->pci_dev->dev, "%s: Total number of OQ: %d\n", __func__, in octeon_create_droq()
964 oct->num_oqs); in octeon_create_droq()