4 * Copyright(c) 2017 Cavium, Inc.. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Cavium, Inc. nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 #include "lio_common.h"
39 #include "lio_response_manager.h"
40 #include "lio_device.h"
42 #include "cn23xx_pf_device.h"
43 #include "lio_network.h"
46 struct lio_stailq_node node;
47 struct lio_recv_info *rinfo;
48 lio_dispatch_fn_t disp_fn;
51 void *lio_get_dispatch_arg(struct octeon_device *oct,
52 uint16_t opcode, uint16_t subcode);
55 * Get the argument that the user set when registering dispatch
56 * function for a given opcode/subcode.
57 * @param octeon_dev - the octeon device pointer.
58 * @param opcode - the opcode for which the dispatch argument
60 * @param subcode - the subcode for which the dispatch argument
62 * @return Success: void * (argument to the dispatch function)
63 * @return Failure: NULL
67 lio_get_dispatch_arg(struct octeon_device *octeon_dev,
68 uint16_t opcode, uint16_t subcode)
70 struct lio_stailq_node *dispatch;
73 uint16_t combined_opcode;
75 combined_opcode = LIO_OPCODE_SUBCODE(opcode, subcode);
77 idx = combined_opcode & LIO_OPCODE_MASK;
79 mtx_lock(&octeon_dev->dispatch.lock);
81 if (octeon_dev->dispatch.count == 0) {
82 mtx_unlock(&octeon_dev->dispatch.lock);
86 if (octeon_dev->dispatch.dlist[idx].opcode == combined_opcode) {
87 fn_arg = octeon_dev->dispatch.dlist[idx].arg;
89 STAILQ_FOREACH(dispatch,
90 &octeon_dev->dispatch.dlist[idx].head, entries) {
91 if (((struct lio_dispatch *)dispatch)->opcode ==
93 fn_arg = ((struct lio_dispatch *)dispatch)->arg;
99 mtx_unlock(&octeon_dev->dispatch.lock);
104 * Check for packets on Droq. This function should be called with lock held.
105 * @param droq - Droq on which count is checked.
106 * @return Returns packet count.
109 lio_droq_check_hw_for_pkts(struct lio_droq *droq)
111 struct octeon_device *oct = droq->oct_dev;
113 uint32_t pkt_count = 0;
115 pkt_count = lio_read_csr32(oct, droq->pkts_sent_reg);
117 last_count = pkt_count - droq->pkt_count;
118 droq->pkt_count = pkt_count;
120 /* we shall write to cnts at the end of processing */
122 atomic_add_int(&droq->pkts_pending, last_count);
128 lio_droq_compute_max_packet_bufs(struct lio_droq *droq)
133 * max_empty_descs is the max. no. of descs that can have no buffers.
134 * If the empty desc count goes beyond this value, we cannot safely
135 * read in a 64K packet sent by Octeon
136 * (64K is max pkt size from Octeon)
138 droq->max_empty_descs = 0;
141 droq->max_empty_descs++;
142 count += droq->buffer_size;
143 } while (count < (64 * 1024));
145 droq->max_empty_descs = droq->max_count - droq->max_empty_descs;
149 lio_droq_reset_indices(struct lio_droq *droq)
153 droq->refill_idx = 0;
154 droq->refill_count = 0;
155 atomic_store_rel_int(&droq->pkts_pending, 0);
159 lio_droq_destroy_ring_buffers(struct octeon_device *oct,
160 struct lio_droq *droq)
164 for (i = 0; i < droq->max_count; i++) {
165 if (droq->recv_buf_list[i].buffer != NULL) {
166 lio_recv_buffer_free(droq->recv_buf_list[i].buffer);
167 droq->recv_buf_list[i].buffer = NULL;
171 lio_droq_reset_indices(droq);
175 lio_droq_setup_ring_buffers(struct octeon_device *oct,
176 struct lio_droq *droq)
178 struct lio_droq_desc *desc_ring = droq->desc_ring;
182 for (i = 0; i < droq->max_count; i++) {
183 buf = lio_recv_buffer_alloc(droq->buffer_size);
186 lio_dev_err(oct, "%s buffer alloc failed\n",
188 droq->stats.rx_alloc_failure++;
192 droq->recv_buf_list[i].buffer = buf;
193 droq->recv_buf_list[i].data = ((struct mbuf *)buf)->m_data;
194 desc_ring[i].info_ptr = 0;
195 desc_ring[i].buffer_ptr =
196 lio_map_ring(oct->device, droq->recv_buf_list[i].buffer,
200 lio_droq_reset_indices(droq);
202 lio_droq_compute_max_packet_bufs(droq);
208 lio_delete_droq(struct octeon_device *oct, uint32_t q_no)
210 struct lio_droq *droq = oct->droq[q_no];
212 lio_dev_dbg(oct, "%s[%d]\n", __func__, q_no);
214 while (taskqueue_cancel(droq->droq_taskqueue, &droq->droq_task, NULL))
215 taskqueue_drain(droq->droq_taskqueue, &droq->droq_task);
217 taskqueue_free(droq->droq_taskqueue);
218 droq->droq_taskqueue = NULL;
220 lio_droq_destroy_ring_buffers(oct, droq);
221 free(droq->recv_buf_list, M_DEVBUF);
223 if (droq->desc_ring != NULL)
224 lio_dma_free((droq->max_count * LIO_DROQ_DESC_SIZE),
227 oct->io_qmask.oq &= ~(1ULL << q_no);
228 bzero(oct->droq[q_no], sizeof(struct lio_droq));
235 lio_droq_bh(void *ptr, int pending __unused)
237 struct lio_droq *droq = ptr;
238 struct octeon_device *oct = droq->oct_dev;
239 struct lio_instr_queue *iq = oct->instr_queue[droq->q_no];
240 int reschedule, tx_done = 1;
242 reschedule = lio_droq_process_packets(oct, droq, oct->rx_budget);
244 if (atomic_load_acq_int(&iq->instr_pending))
245 tx_done = lio_flush_iq(oct, iq, oct->tx_budget);
247 if (reschedule || !tx_done)
248 taskqueue_enqueue(droq->droq_taskqueue, &droq->droq_task);
250 lio_enable_irq(droq, iq);
254 lio_init_droq(struct octeon_device *oct, uint32_t q_no,
255 uint32_t num_descs, uint32_t desc_size, void *app_ctx)
257 struct lio_droq *droq;
259 uint32_t c_buf_size = 0, c_num_descs = 0, c_pkts_per_intr = 0;
260 uint32_t c_refill_threshold = 0, desc_ring_size = 0;
262 lio_dev_dbg(oct, "%s[%d]\n", __func__, q_no);
264 droq = oct->droq[q_no];
265 bzero(droq, LIO_DROQ_SIZE);
270 droq->app_ctx = app_ctx;
272 droq->app_ctx = (void *)(size_t)q_no;
274 c_num_descs = num_descs;
275 c_buf_size = desc_size;
276 if (LIO_CN23XX_PF(oct)) {
277 struct lio_config *conf23 = LIO_CHIP_CONF(oct, cn23xx_pf);
280 (uint32_t)LIO_GET_OQ_PKTS_PER_INTR_CFG(conf23);
282 (uint32_t)LIO_GET_OQ_REFILL_THRESHOLD_CFG(conf23);
287 droq->max_count = c_num_descs;
288 droq->buffer_size = c_buf_size;
290 desc_ring_size = droq->max_count * LIO_DROQ_DESC_SIZE;
291 droq->desc_ring = lio_dma_alloc(desc_ring_size, &droq->desc_ring_dma);
292 if (droq->desc_ring == NULL) {
293 lio_dev_err(oct, "Output queue %d ring alloc failed\n", q_no);
297 lio_dev_dbg(oct, "droq[%d]: desc_ring: virt: 0x%p, dma: %llx\n", q_no,
298 droq->desc_ring, LIO_CAST64(droq->desc_ring_dma));
299 lio_dev_dbg(oct, "droq[%d]: num_desc: %d\n", q_no, droq->max_count);
301 size = droq->max_count * LIO_DROQ_RECVBUF_SIZE;
302 droq->recv_buf_list =
303 (struct lio_recv_buffer *)malloc(size, M_DEVBUF,
305 if (droq->recv_buf_list == NULL) {
306 lio_dev_err(oct, "Output queue recv buf list alloc failed\n");
310 if (lio_droq_setup_ring_buffers(oct, droq))
313 droq->pkts_per_intr = c_pkts_per_intr;
314 droq->refill_threshold = c_refill_threshold;
316 lio_dev_dbg(oct, "DROQ INIT: max_empty_descs: %d\n",
317 droq->max_empty_descs);
319 mtx_init(&droq->lock, "droq_lock", NULL, MTX_DEF);
321 STAILQ_INIT(&droq->dispatch_stq_head);
323 oct->fn_list.setup_oq_regs(oct, q_no);
325 oct->io_qmask.oq |= BIT_ULL(q_no);
328 * Initialize the taskqueue that handles
329 * output queue packet processing.
331 lio_dev_dbg(oct, "Initializing droq%d taskqueue\n", q_no);
332 TASK_INIT(&droq->droq_task, 0, lio_droq_bh, (void *)droq);
334 droq->droq_taskqueue = taskqueue_create_fast("lio_droq_task", M_NOWAIT,
335 taskqueue_thread_enqueue,
336 &droq->droq_taskqueue);
337 taskqueue_start_threads_cpuset(&droq->droq_taskqueue, 1, PI_NET,
338 &oct->ioq_vector[q_no].affinity_mask,
339 "lio%d_droq%d_task", oct->octeon_id,
345 lio_delete_droq(oct, q_no);
350 * lio_create_recv_info
352 * octeon_dev - pointer to the octeon device structure
353 * droq - droq in which the packet arrived.
354 * buf_cnt - no. of buffers used by the packet.
355 * idx - index in the descriptor for the first buffer in the packet.
357 * Allocates a recv_info_t and copies the buffer addresses for packet data
358 * into the recv_pkt space which starts at an 8B offset from recv_info_t.
359 * Flags the descriptors for refill later. If available descriptors go
360 * below the threshold to receive a 64K pkt, new buffers are first allocated
361 * before the recv_pkt_t is created.
362 * This routine will be called in interrupt context.
364 * Success: Pointer to recv_info_t
367 * The droq->lock is held when this routine is called.
369 static inline struct lio_recv_info *
370 lio_create_recv_info(struct octeon_device *octeon_dev, struct lio_droq *droq,
371 uint32_t buf_cnt, uint32_t idx)
373 struct lio_droq_info *info;
374 struct lio_recv_pkt *recv_pkt;
375 struct lio_recv_info *recv_info;
376 uint32_t bytes_left, i;
378 info = (struct lio_droq_info *)droq->recv_buf_list[idx].data;
380 recv_info = lio_alloc_recv_info(sizeof(struct __dispatch));
381 if (recv_info == NULL)
384 recv_pkt = recv_info->recv_pkt;
385 recv_pkt->rh = info->rh;
386 recv_pkt->length = (uint32_t)info->length;
387 recv_pkt->buffer_count = (uint16_t)buf_cnt;
388 recv_pkt->octeon_id = (uint16_t)octeon_dev->octeon_id;
391 bytes_left = (uint32_t)info->length;
394 recv_pkt->buffer_size[i] = (bytes_left >= droq->buffer_size) ?
395 droq->buffer_size : bytes_left;
397 recv_pkt->buffer_ptr[i] = droq->recv_buf_list[idx].buffer;
398 droq->recv_buf_list[idx].buffer = NULL;
400 idx = lio_incr_index(idx, 1, droq->max_count);
401 bytes_left -= droq->buffer_size;
410 * If we were not able to refill all buffers, try to move around
411 * the buffers that were not dispatched.
413 static inline uint32_t
414 lio_droq_refill_pullup_descs(struct lio_droq *droq,
415 struct lio_droq_desc *desc_ring)
417 uint32_t desc_refilled = 0;
418 uint32_t refill_index = droq->refill_idx;
420 while (refill_index != droq->read_idx) {
421 if (droq->recv_buf_list[refill_index].buffer != NULL) {
422 droq->recv_buf_list[droq->refill_idx].buffer =
423 droq->recv_buf_list[refill_index].buffer;
424 droq->recv_buf_list[droq->refill_idx].data =
425 droq->recv_buf_list[refill_index].data;
426 desc_ring[droq->refill_idx].buffer_ptr =
427 desc_ring[refill_index].buffer_ptr;
428 droq->recv_buf_list[refill_index].buffer = NULL;
429 desc_ring[refill_index].buffer_ptr = 0;
432 lio_incr_index(droq->refill_idx, 1,
435 droq->refill_count--;
436 } while (droq->recv_buf_list[droq->refill_idx].buffer !=
439 refill_index = lio_incr_index(refill_index, 1, droq->max_count);
441 return (desc_refilled);
447 * droq - droq in which descriptors require new buffers.
449 * Called during normal DROQ processing in interrupt mode or by the poll
450 * thread to refill the descriptors from which buffers were dispatched
451 * to upper layers. Attempts to allocate new buffers. If that fails, moves
452 * up buffers (that were not dispatched) to form a contiguous ring.
454 * No of descriptors refilled.
456 * This routine is called with droq->lock held.
459 lio_droq_refill(struct octeon_device *octeon_dev, struct lio_droq *droq)
461 struct lio_droq_desc *desc_ring;
463 uint32_t desc_refilled = 0;
466 desc_ring = droq->desc_ring;
468 while (droq->refill_count && (desc_refilled < droq->max_count)) {
470 * If a valid buffer exists (happens if there is no dispatch),
472 * the buffer, else allocate.
474 if (droq->recv_buf_list[droq->refill_idx].buffer == NULL) {
475 buf = lio_recv_buffer_alloc(droq->buffer_size);
477 * If a buffer could not be allocated, no point in
481 droq->stats.rx_alloc_failure++;
485 droq->recv_buf_list[droq->refill_idx].buffer = buf;
486 data = ((struct mbuf *)buf)->m_data;
488 data = ((struct mbuf *)droq->recv_buf_list
489 [droq->refill_idx].buffer)->m_data;
492 droq->recv_buf_list[droq->refill_idx].data = data;
494 desc_ring[droq->refill_idx].buffer_ptr =
495 lio_map_ring(octeon_dev->device,
496 droq->recv_buf_list[droq->refill_idx].buffer,
499 droq->refill_idx = lio_incr_index(droq->refill_idx, 1,
502 droq->refill_count--;
505 if (droq->refill_count)
506 desc_refilled += lio_droq_refill_pullup_descs(droq, desc_ring);
509 * if droq->refill_count
510 * The refill count would not change in pass two. We only moved buffers
511 * to close the gap in the ring, but we would still have the same no. of
514 return (desc_refilled);
517 static inline uint32_t
518 lio_droq_get_bufcount(uint32_t buf_size, uint32_t total_len)
521 return ((total_len + buf_size - 1) / buf_size);
525 lio_droq_dispatch_pkt(struct octeon_device *oct, struct lio_droq *droq,
526 union octeon_rh *rh, struct lio_droq_info *info)
528 struct lio_recv_info *rinfo;
529 lio_dispatch_fn_t disp_fn;
532 cnt = lio_droq_get_bufcount(droq->buffer_size, (uint32_t)info->length);
534 disp_fn = lio_get_dispatch(oct, (uint16_t)rh->r.opcode,
535 (uint16_t)rh->r.subcode);
537 rinfo = lio_create_recv_info(oct, droq, cnt, droq->read_idx);
539 struct __dispatch *rdisp = rinfo->rsvd;
541 rdisp->rinfo = rinfo;
542 rdisp->disp_fn = disp_fn;
543 rinfo->recv_pkt->rh = *rh;
544 STAILQ_INSERT_TAIL(&droq->dispatch_stq_head,
545 &rdisp->node, entries);
547 droq->stats.dropped_nomem++;
550 lio_dev_err(oct, "DROQ: No dispatch function (opcode %u/%u)\n",
551 (unsigned int)rh->r.opcode,
552 (unsigned int)rh->r.subcode);
553 droq->stats.dropped_nodispatch++;
560 lio_droq_drop_packets(struct octeon_device *oct, struct lio_droq *droq,
563 struct lio_droq_info *info;
564 uint32_t i = 0, buf_cnt;
566 for (i = 0; i < cnt; i++) {
567 info = (struct lio_droq_info *)
568 droq->recv_buf_list[droq->read_idx].data;
570 lio_swap_8B_data((uint64_t *)info, 2);
574 droq->stats.bytes_received += info->length;
575 buf_cnt = lio_droq_get_bufcount(droq->buffer_size,
576 (uint32_t)info->length);
578 lio_dev_err(oct, "DROQ: In drop: pkt with len 0\n");
582 droq->read_idx = lio_incr_index(droq->read_idx, buf_cnt,
584 droq->refill_count += buf_cnt;
589 lio_droq_fast_process_packets(struct octeon_device *oct, struct lio_droq *droq,
590 uint32_t pkts_to_process)
592 struct lio_droq_info *info;
594 uint32_t pkt, pkt_count, total_len = 0;
596 pkt_count = pkts_to_process;
598 for (pkt = 0; pkt < pkt_count; pkt++) {
599 struct mbuf *nicbuf = NULL;
600 uint32_t pkt_len = 0;
602 info = (struct lio_droq_info *)
603 droq->recv_buf_list[droq->read_idx].data;
605 lio_swap_8B_data((uint64_t *)info, 2);
609 "DROQ[%d] idx: %d len:0, pkt_cnt: %d\n",
610 droq->q_no, droq->read_idx, pkt_count);
611 hexdump((uint8_t *)info, LIO_DROQ_INFO_SIZE, NULL,
614 lio_incr_index(droq->read_idx, 1, droq->max_count);
615 droq->refill_count++;
622 rh->r_dh.len += (LIO_DROQ_INFO_SIZE + 7) / 8;
624 total_len += (uint32_t)info->length;
625 if (lio_opcode_slow_path(rh)) {
628 buf_cnt = lio_droq_dispatch_pkt(oct, droq, rh, info);
629 droq->read_idx = lio_incr_index(droq->read_idx, buf_cnt,
631 droq->refill_count += buf_cnt;
633 if (info->length <= droq->buffer_size) {
634 pkt_len = (uint32_t)info->length;
635 nicbuf = droq->recv_buf_list[
636 droq->read_idx].buffer;
637 nicbuf->m_len = pkt_len;
638 droq->recv_buf_list[droq->read_idx].buffer =
642 lio_incr_index(droq->read_idx,
644 droq->refill_count++;
646 bool secondary_frag = false;
650 while (pkt_len < info->length) {
651 int frag_len, idx = droq->read_idx;
655 ((pkt_len + droq->buffer_size) >
657 ((uint32_t)info->length -
658 pkt_len) : droq->buffer_size;
660 buffer = ((struct mbuf *)
661 droq->recv_buf_list[idx].
663 buffer->m_len = frag_len;
664 if (__predict_true(secondary_frag)) {
665 m_cat(nicbuf, buffer);
668 secondary_frag = true;
671 droq->recv_buf_list[droq->read_idx].
676 lio_incr_index(droq->read_idx,
679 droq->refill_count++;
683 if (nicbuf != NULL) {
684 if (droq->ops.fptr != NULL) {
685 droq->ops.fptr(nicbuf, pkt_len, rh,
686 droq, droq->ops.farg);
688 lio_recv_buffer_free(nicbuf);
693 if (droq->refill_count >= droq->refill_threshold) {
694 int desc_refilled = lio_droq_refill(oct, droq);
697 * Flush the droq descriptor data to memory to be sure
698 * that when we update the credits the data in memory
702 lio_write_csr32(oct, droq->pkts_credit_reg,
704 /* make sure mmio write completes */
707 } /* for (each packet)... */
709 /* Increment refill_count by the number of buffers processed. */
710 droq->stats.pkts_received += pkt;
711 droq->stats.bytes_received += total_len;
713 tcp_lro_flush_all(&droq->lro);
715 if ((droq->ops.drop_on_max) && (pkts_to_process - pkt)) {
716 lio_droq_drop_packets(oct, droq, (pkts_to_process - pkt));
718 droq->stats.dropped_toomany += (pkts_to_process - pkt);
719 return (pkts_to_process);
726 lio_droq_process_packets(struct octeon_device *oct, struct lio_droq *droq,
729 struct lio_stailq_node *tmp, *tmp2;
730 uint32_t pkt_count = 0, pkts_processed = 0;
732 /* Grab the droq lock */
733 mtx_lock(&droq->lock);
735 lio_droq_check_hw_for_pkts(droq);
736 pkt_count = atomic_load_acq_int(&droq->pkts_pending);
739 mtx_unlock(&droq->lock);
742 if (pkt_count > budget)
745 pkts_processed = lio_droq_fast_process_packets(oct, droq, pkt_count);
747 atomic_subtract_int(&droq->pkts_pending, pkts_processed);
749 /* Release the lock */
750 mtx_unlock(&droq->lock);
752 STAILQ_FOREACH_SAFE(tmp, &droq->dispatch_stq_head, entries, tmp2) {
753 struct __dispatch *rdisp = (struct __dispatch *)tmp;
755 STAILQ_REMOVE_HEAD(&droq->dispatch_stq_head, entries);
756 rdisp->disp_fn(rdisp->rinfo, lio_get_dispatch_arg(oct,
757 (uint16_t)rdisp->rinfo->recv_pkt->rh.r.opcode,
758 (uint16_t)rdisp->rinfo->recv_pkt->rh.r.subcode));
761 /* If there are packets pending. schedule tasklet again */
762 if (atomic_load_acq_int(&droq->pkts_pending))
769 lio_register_droq_ops(struct octeon_device *oct, uint32_t q_no,
770 struct lio_droq_ops *ops)
772 struct lio_droq *droq;
773 struct lio_config *lio_cfg = NULL;
775 lio_cfg = lio_get_conf(oct);
781 lio_dev_err(oct, "%s: droq_ops pointer is NULL\n", __func__);
785 if (q_no >= LIO_GET_OQ_MAX_Q_CFG(lio_cfg)) {
786 lio_dev_err(oct, "%s: droq id (%d) exceeds MAX (%d)\n",
787 __func__, q_no, (oct->num_oqs - 1));
790 droq = oct->droq[q_no];
792 mtx_lock(&droq->lock);
794 memcpy(&droq->ops, ops, sizeof(struct lio_droq_ops));
796 mtx_unlock(&droq->lock);
802 lio_unregister_droq_ops(struct octeon_device *oct, uint32_t q_no)
804 struct lio_droq *droq;
805 struct lio_config *lio_cfg = NULL;
807 lio_cfg = lio_get_conf(oct);
812 if (q_no >= LIO_GET_OQ_MAX_Q_CFG(lio_cfg)) {
813 lio_dev_err(oct, "%s: droq id (%d) exceeds MAX (%d)\n",
814 __func__, q_no, oct->num_oqs - 1);
818 droq = oct->droq[q_no];
821 lio_dev_info(oct, "Droq id (%d) not available.\n", q_no);
825 mtx_lock(&droq->lock);
827 droq->ops.fptr = NULL;
828 droq->ops.farg = NULL;
829 droq->ops.drop_on_max = 0;
831 mtx_unlock(&droq->lock);
837 lio_create_droq(struct octeon_device *oct, uint32_t q_no, uint32_t num_descs,
838 uint32_t desc_size, void *app_ctx)
841 if (oct->droq[q_no]->oct_dev != NULL) {
842 lio_dev_dbg(oct, "Droq already in use. Cannot create droq %d again\n",
847 /* Initialize the Droq */
848 if (lio_init_droq(oct, q_no, num_descs, desc_size, app_ctx)) {
849 bzero(oct->droq[q_no], sizeof(struct lio_droq));
850 goto create_droq_fail;
855 lio_dev_dbg(oct, "%s: Total number of OQ: %d\n", __func__,
858 /* Global Droq register settings */
861 * As of now not required, as setting are done for all 32 Droqs at