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()
288 dev_err(&oct->pci_dev->dev, "Output queue recv buf list alloc failed\n"); in octeon_init_droq()
292 if (octeon_droq_setup_ring_buffers(oct, droq)) in octeon_init_droq()
298 dev_dbg(&oct->pci_dev->dev, "DROQ INIT: max_empty_descs: %d\n", in octeon_init_droq()
304 oct->fn_list.setup_oq_regs(oct, q_no); in octeon_init_droq()
306 oct->io_qmask.oq |= BIT_ULL(q_no); in octeon_init_droq()
311 octeon_delete_droq(oct, q_no); in octeon_init_droq()
500 struct octeon_device *oct = droq->oct_dev; in octeon_retry_droq_refill() local
505 desc_refilled = octeon_droq_refill(oct, droq); in octeon_retry_droq_refill()
528 octeon_droq_dispatch_pkt(struct octeon_device *oct, in octeon_droq_dispatch_pkt() argument
539 disp_fn = octeon_get_dispatch(oct, (u16)rh->r.opcode, in octeon_droq_dispatch_pkt()
542 rinfo = octeon_create_recv_info(oct, droq, cnt, droq->read_idx); in octeon_droq_dispatch_pkt()
555 dev_err(&oct->pci_dev->dev, "DROQ: No dispatch function (opcode %u/%u)\n", in octeon_droq_dispatch_pkt()
564 static inline void octeon_droq_drop_packets(struct octeon_device *oct, in octeon_droq_drop_packets() argument
582 dev_err(&oct->pci_dev->dev, "DROQ: In drop: pkt with len 0\n"); in octeon_droq_drop_packets()
593 octeon_droq_fast_process_packets(struct octeon_device *oct, in octeon_droq_fast_process_packets() argument
614 dev_err(&oct->pci_dev->dev, in octeon_droq_fast_process_packets()
632 buf_cnt = octeon_droq_dispatch_pkt(oct, droq, rh, info); in octeon_droq_fast_process_packets()
643 if (recv_buffer_recycle(oct, pg_info)) in octeon_droq_fast_process_packets()
690 droq->ops.fptr(oct->octeon_id, in octeon_droq_fast_process_packets()
701 int desc_refilled = octeon_droq_refill(oct, droq); in octeon_droq_fast_process_packets()
720 octeon_droq_drop_packets(oct, droq, (pkts_to_process - pkt)); in octeon_droq_fast_process_packets()
734 octeon_schedule_rxq_oom_work(oct, droq); in octeon_droq_fast_process_packets()
741 octeon_droq_process_packets(struct octeon_device *oct, in octeon_droq_process_packets() argument
757 octeon_droq_fast_process_packets(oct, droq, pkt_count); in octeon_droq_process_packets()
765 (oct, in octeon_droq_process_packets()
783 octeon_droq_process_poll_pkts(struct octeon_device *oct, in octeon_droq_process_poll_pkts() argument
803 octeon_droq_fast_process_packets(oct, droq, in octeon_droq_process_poll_pkts()
815 (oct, in octeon_droq_process_poll_pkts()
825 octeon_enable_irq(struct octeon_device *oct, u32 q_no) in octeon_enable_irq() argument
827 switch (oct->chip_id) { in octeon_enable_irq()
831 (struct octeon_cn6xxx *)oct->chip; in octeon_enable_irq()
837 value = octeon_read_csr(oct, CN6XXX_SLI_PKT_TIME_INT_ENB); in octeon_enable_irq()
839 octeon_write_csr(oct, CN6XXX_SLI_PKT_TIME_INT_ENB, value); in octeon_enable_irq()
840 value = octeon_read_csr(oct, CN6XXX_SLI_PKT_CNT_INT_ENB); in octeon_enable_irq()
842 octeon_write_csr(oct, CN6XXX_SLI_PKT_CNT_INT_ENB, value); in octeon_enable_irq()
851 lio_enable_irq(oct->droq[q_no], oct->instr_queue[q_no]); in octeon_enable_irq()
855 lio_enable_irq(oct->droq[q_no], oct->instr_queue[q_no]); in octeon_enable_irq()
858 dev_err(&oct->pci_dev->dev, "%s Unknown Chip\n", __func__); in octeon_enable_irq()
865 int octeon_register_droq_ops(struct octeon_device *oct, u32 q_no, in octeon_register_droq_ops() argument
871 oct_cfg = octeon_get_conf(oct); in octeon_register_droq_ops()
877 dev_err(&oct->pci_dev->dev, "%s: droq_ops pointer is NULL\n", in octeon_register_droq_ops()
883 dev_err(&oct->pci_dev->dev, "%s: droq id (%d) exceeds MAX (%d)\n", in octeon_register_droq_ops()
884 __func__, q_no, (oct->num_oqs - 1)); in octeon_register_droq_ops()
888 droq = oct->droq[q_no]; in octeon_register_droq_ops()
894 int octeon_unregister_droq_ops(struct octeon_device *oct, u32 q_no) in octeon_unregister_droq_ops() argument
899 oct_cfg = octeon_get_conf(oct); in octeon_unregister_droq_ops()
905 dev_err(&oct->pci_dev->dev, "%s: droq id (%d) exceeds MAX (%d)\n", in octeon_unregister_droq_ops()
906 __func__, q_no, oct->num_oqs - 1); in octeon_unregister_droq_ops()
910 droq = oct->droq[q_no]; in octeon_unregister_droq_ops()
913 dev_info(&oct->pci_dev->dev, in octeon_unregister_droq_ops()
925 int octeon_create_droq(struct octeon_device *oct, in octeon_create_droq() argument
930 int numa_node = dev_to_node(&oct->pci_dev->dev); in octeon_create_droq()
932 if (oct->droq[q_no]) { in octeon_create_droq()
933 dev_dbg(&oct->pci_dev->dev, "Droq already in use. Cannot create droq %d again\n", in octeon_create_droq()
948 octeon_set_droq_pkt_op(oct, q_no, 0); in octeon_create_droq()
949 oct->droq[q_no] = droq; in octeon_create_droq()
952 if (octeon_init_droq(oct, q_no, num_descs, desc_size, app_ctx)) { in octeon_create_droq()
953 vfree(oct->droq[q_no]); in octeon_create_droq()
954 oct->droq[q_no] = NULL; in octeon_create_droq()
958 oct->num_oqs++; in octeon_create_droq()
960 dev_dbg(&oct->pci_dev->dev, "%s: Total number of OQ: %d\n", __func__, in octeon_create_droq()
961 oct->num_oqs); in octeon_create_droq()