Lines Matching refs:tx_queue
272 static inline void ef4_farch_notify_tx_desc(struct ef4_tx_queue *tx_queue) in ef4_farch_notify_tx_desc() argument
277 write_ptr = tx_queue->write_count & tx_queue->ptr_mask; in ef4_farch_notify_tx_desc()
279 ef4_writed_page(tx_queue->efx, ®, in ef4_farch_notify_tx_desc()
280 FR_AZ_TX_DESC_UPD_DWORD_P0, tx_queue->queue); in ef4_farch_notify_tx_desc()
284 static inline void ef4_farch_push_tx_desc(struct ef4_tx_queue *tx_queue, in ef4_farch_push_tx_desc() argument
293 write_ptr = tx_queue->write_count & tx_queue->ptr_mask; in ef4_farch_push_tx_desc()
297 ef4_writeo_page(tx_queue->efx, ®, in ef4_farch_push_tx_desc()
298 FR_BZ_TX_DESC_UPD_P0, tx_queue->queue); in ef4_farch_push_tx_desc()
306 void ef4_farch_tx_write(struct ef4_tx_queue *tx_queue) in ef4_farch_tx_write() argument
311 unsigned old_write_count = tx_queue->write_count; in ef4_farch_tx_write()
313 tx_queue->xmit_more_available = false; in ef4_farch_tx_write()
314 if (unlikely(tx_queue->write_count == tx_queue->insert_count)) in ef4_farch_tx_write()
318 write_ptr = tx_queue->write_count & tx_queue->ptr_mask; in ef4_farch_tx_write()
319 buffer = &tx_queue->buffer[write_ptr]; in ef4_farch_tx_write()
320 txd = ef4_tx_desc(tx_queue, write_ptr); in ef4_farch_tx_write()
321 ++tx_queue->write_count; in ef4_farch_tx_write()
333 } while (tx_queue->write_count != tx_queue->insert_count); in ef4_farch_tx_write()
337 if (ef4_nic_may_push_tx_desc(tx_queue, old_write_count)) { in ef4_farch_tx_write()
338 txd = ef4_tx_desc(tx_queue, in ef4_farch_tx_write()
339 old_write_count & tx_queue->ptr_mask); in ef4_farch_tx_write()
340 ef4_farch_push_tx_desc(tx_queue, txd); in ef4_farch_tx_write()
341 ++tx_queue->pushes; in ef4_farch_tx_write()
343 ef4_farch_notify_tx_desc(tx_queue); in ef4_farch_tx_write()
347 unsigned int ef4_farch_tx_limit_len(struct ef4_tx_queue *tx_queue, in ef4_farch_tx_limit_len() argument
355 if (EF4_WORKAROUND_5391(tx_queue->efx) && (dma_addr & 0xf)) in ef4_farch_tx_limit_len()
363 int ef4_farch_tx_probe(struct ef4_tx_queue *tx_queue) in ef4_farch_tx_probe() argument
365 struct ef4_nic *efx = tx_queue->efx; in ef4_farch_tx_probe()
368 entries = tx_queue->ptr_mask + 1; in ef4_farch_tx_probe()
369 return ef4_alloc_special_buffer(efx, &tx_queue->txd, in ef4_farch_tx_probe()
373 void ef4_farch_tx_init(struct ef4_tx_queue *tx_queue) in ef4_farch_tx_init() argument
375 struct ef4_nic *efx = tx_queue->efx; in ef4_farch_tx_init()
379 ef4_init_special_buffer(efx, &tx_queue->txd); in ef4_farch_tx_init()
386 FRF_AZ_TX_DESCQ_BUF_BASE_ID, tx_queue->txd.index, in ef4_farch_tx_init()
388 tx_queue->channel->channel, in ef4_farch_tx_init()
390 FRF_AZ_TX_DESCQ_LABEL, tx_queue->queue, in ef4_farch_tx_init()
392 __ffs(tx_queue->txd.entries), in ef4_farch_tx_init()
397 int csum = tx_queue->queue & EF4_TXQ_TYPE_OFFLOAD; in ef4_farch_tx_init()
404 tx_queue->queue); in ef4_farch_tx_init()
411 if (tx_queue->queue & EF4_TXQ_TYPE_OFFLOAD) in ef4_farch_tx_init()
412 __clear_bit_le(tx_queue->queue, ®); in ef4_farch_tx_init()
414 __set_bit_le(tx_queue->queue, ®); in ef4_farch_tx_init()
421 (tx_queue->queue & EF4_TXQ_TYPE_HIGHPRI) ? in ef4_farch_tx_init()
425 tx_queue->queue); in ef4_farch_tx_init()
429 static void ef4_farch_flush_tx_queue(struct ef4_tx_queue *tx_queue) in ef4_farch_flush_tx_queue() argument
431 struct ef4_nic *efx = tx_queue->efx; in ef4_farch_flush_tx_queue()
434 WARN_ON(atomic_read(&tx_queue->flush_outstanding)); in ef4_farch_flush_tx_queue()
435 atomic_set(&tx_queue->flush_outstanding, 1); in ef4_farch_flush_tx_queue()
439 FRF_AZ_TX_FLUSH_DESCQ, tx_queue->queue); in ef4_farch_flush_tx_queue()
443 void ef4_farch_tx_fini(struct ef4_tx_queue *tx_queue) in ef4_farch_tx_fini() argument
445 struct ef4_nic *efx = tx_queue->efx; in ef4_farch_tx_fini()
451 tx_queue->queue); in ef4_farch_tx_fini()
454 ef4_fini_special_buffer(efx, &tx_queue->txd); in ef4_farch_tx_fini()
458 void ef4_farch_tx_remove(struct ef4_tx_queue *tx_queue) in ef4_farch_tx_remove() argument
460 ef4_free_special_buffer(tx_queue->efx, &tx_queue->txd); in ef4_farch_tx_remove()
619 struct ef4_tx_queue *tx_queue; in ef4_check_tx_flush_complete() local
622 ef4_for_each_channel_tx_queue(tx_queue, channel) { in ef4_check_tx_flush_complete()
624 FR_BZ_TX_DESC_PTR_TBL, tx_queue->queue); in ef4_check_tx_flush_complete()
631 tx_queue->queue); in ef4_check_tx_flush_complete()
633 } else if (atomic_cmpxchg(&tx_queue->flush_outstanding, in ef4_check_tx_flush_complete()
640 "the queue\n", tx_queue->queue); in ef4_check_tx_flush_complete()
647 tx_queue)); in ef4_check_tx_flush_complete()
663 struct ef4_tx_queue *tx_queue; in ef4_farch_do_flush() local
667 ef4_for_each_channel_tx_queue(tx_queue, channel) { in ef4_farch_do_flush()
668 ef4_farch_flush_tx_queue(tx_queue); in ef4_farch_do_flush()
720 struct ef4_tx_queue *tx_queue; in ef4_farch_fini_dmaq() local
736 ef4_for_each_channel_tx_queue(tx_queue, channel) in ef4_farch_fini_dmaq()
737 ef4_farch_tx_fini(tx_queue); in ef4_farch_fini_dmaq()
830 struct ef4_tx_queue *tx_queue; in ef4_farch_handle_tx_event() local
841 tx_queue = ef4_channel_get_tx_queue( in ef4_farch_handle_tx_event()
843 tx_packets = ((tx_ev_desc_ptr - tx_queue->read_count) & in ef4_farch_handle_tx_event()
844 tx_queue->ptr_mask); in ef4_farch_handle_tx_event()
845 ef4_xmit_done(tx_queue, tx_ev_desc_ptr); in ef4_farch_handle_tx_event()
849 tx_queue = ef4_channel_get_tx_queue( in ef4_farch_handle_tx_event()
853 ef4_farch_notify_tx_desc(tx_queue); in ef4_farch_handle_tx_event()
1092 struct ef4_tx_queue *tx_queue; in ef4_farch_handle_tx_flush_done() local
1097 tx_queue = ef4_get_tx_queue(efx, qid / EF4_TXQ_TYPES, in ef4_farch_handle_tx_flush_done()
1099 if (atomic_cmpxchg(&tx_queue->flush_outstanding, 1, 0)) { in ef4_farch_handle_tx_flush_done()
1100 ef4_farch_magic_event(tx_queue->channel, in ef4_farch_handle_tx_flush_done()
1101 EF4_CHANNEL_MAGIC_TX_DRAIN(tx_queue)); in ef4_farch_handle_tx_flush_done()