Lines Matching refs:tx_queue

283 static inline void efx_farch_notify_tx_desc(struct efx_tx_queue *tx_queue)  in efx_farch_notify_tx_desc()  argument
288 write_ptr = tx_queue->write_count & tx_queue->ptr_mask; in efx_farch_notify_tx_desc()
290 efx_writed_page(tx_queue->efx, &reg, in efx_farch_notify_tx_desc()
291 FR_AZ_TX_DESC_UPD_DWORD_P0, tx_queue->queue); in efx_farch_notify_tx_desc()
295 static inline void efx_farch_push_tx_desc(struct efx_tx_queue *tx_queue, in efx_farch_push_tx_desc() argument
304 write_ptr = tx_queue->write_count & tx_queue->ptr_mask; in efx_farch_push_tx_desc()
308 efx_writeo_page(tx_queue->efx, &reg, in efx_farch_push_tx_desc()
309 FR_BZ_TX_DESC_UPD_P0, tx_queue->queue); in efx_farch_push_tx_desc()
317 void efx_farch_tx_write(struct efx_tx_queue *tx_queue) in efx_farch_tx_write() argument
322 unsigned old_write_count = tx_queue->write_count; in efx_farch_tx_write()
324 tx_queue->xmit_pending = false; in efx_farch_tx_write()
325 if (unlikely(tx_queue->write_count == tx_queue->insert_count)) in efx_farch_tx_write()
329 write_ptr = tx_queue->write_count & tx_queue->ptr_mask; in efx_farch_tx_write()
330 buffer = &tx_queue->buffer[write_ptr]; in efx_farch_tx_write()
331 txd = efx_tx_desc(tx_queue, write_ptr); in efx_farch_tx_write()
332 ++tx_queue->write_count; in efx_farch_tx_write()
344 } while (tx_queue->write_count != tx_queue->insert_count); in efx_farch_tx_write()
348 if (efx_nic_may_push_tx_desc(tx_queue, old_write_count)) { in efx_farch_tx_write()
349 txd = efx_tx_desc(tx_queue, in efx_farch_tx_write()
350 old_write_count & tx_queue->ptr_mask); in efx_farch_tx_write()
351 efx_farch_push_tx_desc(tx_queue, txd); in efx_farch_tx_write()
352 ++tx_queue->pushes; in efx_farch_tx_write()
354 efx_farch_notify_tx_desc(tx_queue); in efx_farch_tx_write()
358 unsigned int efx_farch_tx_limit_len(struct efx_tx_queue *tx_queue, in efx_farch_tx_limit_len() argument
371 int efx_farch_tx_probe(struct efx_tx_queue *tx_queue) in efx_farch_tx_probe() argument
373 struct efx_nic *efx = tx_queue->efx; in efx_farch_tx_probe()
376 tx_queue->type = ((tx_queue->label & 1) ? EFX_TXQ_TYPE_OUTER_CSUM : 0) | in efx_farch_tx_probe()
377 ((tx_queue->label & 2) ? EFX_TXQ_TYPE_HIGHPRI : 0); in efx_farch_tx_probe()
378 entries = tx_queue->ptr_mask + 1; in efx_farch_tx_probe()
379 return efx_alloc_special_buffer(efx, &tx_queue->txd, in efx_farch_tx_probe()
383 void efx_farch_tx_init(struct efx_tx_queue *tx_queue) in efx_farch_tx_init() argument
385 int csum = tx_queue->type & EFX_TXQ_TYPE_OUTER_CSUM; in efx_farch_tx_init()
386 struct efx_nic *efx = tx_queue->efx; in efx_farch_tx_init()
390 efx_init_special_buffer(efx, &tx_queue->txd); in efx_farch_tx_init()
397 FRF_AZ_TX_DESCQ_BUF_BASE_ID, tx_queue->txd.index, in efx_farch_tx_init()
399 tx_queue->channel->channel, in efx_farch_tx_init()
401 FRF_AZ_TX_DESCQ_LABEL, tx_queue->label, in efx_farch_tx_init()
403 __ffs(tx_queue->txd.entries), in efx_farch_tx_init()
411 tx_queue->queue); in efx_farch_tx_init()
415 (tx_queue->type & EFX_TXQ_TYPE_HIGHPRI) ? in efx_farch_tx_init()
418 efx_writeo_table(efx, &reg, FR_BZ_TX_PACE_TBL, tx_queue->queue); in efx_farch_tx_init()
420 tx_queue->tso_version = 1; in efx_farch_tx_init()
423 static void efx_farch_flush_tx_queue(struct efx_tx_queue *tx_queue) in efx_farch_flush_tx_queue() argument
425 struct efx_nic *efx = tx_queue->efx; in efx_farch_flush_tx_queue()
428 WARN_ON(atomic_read(&tx_queue->flush_outstanding)); in efx_farch_flush_tx_queue()
429 atomic_set(&tx_queue->flush_outstanding, 1); in efx_farch_flush_tx_queue()
433 FRF_AZ_TX_FLUSH_DESCQ, tx_queue->queue); in efx_farch_flush_tx_queue()
437 void efx_farch_tx_fini(struct efx_tx_queue *tx_queue) in efx_farch_tx_fini() argument
439 struct efx_nic *efx = tx_queue->efx; in efx_farch_tx_fini()
445 tx_queue->queue); in efx_farch_tx_fini()
448 efx_fini_special_buffer(efx, &tx_queue->txd); in efx_farch_tx_fini()
452 void efx_farch_tx_remove(struct efx_tx_queue *tx_queue) in efx_farch_tx_remove() argument
454 efx_free_special_buffer(tx_queue->efx, &tx_queue->txd); in efx_farch_tx_remove()
607 struct efx_tx_queue *tx_queue; in efx_check_tx_flush_complete() local
610 efx_for_each_channel_tx_queue(tx_queue, channel) { in efx_check_tx_flush_complete()
612 FR_BZ_TX_DESC_PTR_TBL, tx_queue->queue); in efx_check_tx_flush_complete()
619 tx_queue->queue); in efx_check_tx_flush_complete()
621 } else if (atomic_cmpxchg(&tx_queue->flush_outstanding, in efx_check_tx_flush_complete()
628 "the queue\n", tx_queue->queue); in efx_check_tx_flush_complete()
635 tx_queue)); in efx_check_tx_flush_complete()
651 struct efx_tx_queue *tx_queue; in efx_farch_do_flush() local
655 efx_for_each_channel_tx_queue(tx_queue, channel) { in efx_farch_do_flush()
656 efx_farch_flush_tx_queue(tx_queue); in efx_farch_do_flush()
719 struct efx_tx_queue *tx_queue; in efx_farch_fini_dmaq() local
735 efx_for_each_channel_tx_queue(tx_queue, channel) in efx_farch_fini_dmaq()
736 efx_farch_tx_fini(tx_queue); in efx_farch_fini_dmaq()
830 struct efx_tx_queue *tx_queue; in efx_farch_handle_tx_event() local
840 tx_queue = channel->tx_queue + in efx_farch_handle_tx_event()
842 efx_siena_xmit_done(tx_queue, tx_ev_desc_ptr); in efx_farch_handle_tx_event()
846 tx_queue = channel->tx_queue + in efx_farch_handle_tx_event()
850 efx_farch_notify_tx_desc(tx_queue); in efx_farch_handle_tx_event()
1085 struct efx_tx_queue *tx_queue; in efx_farch_handle_tx_flush_done() local
1092 tx_queue = channel->tx_queue + (qid % EFX_MAX_TXQ_PER_CHANNEL); in efx_farch_handle_tx_flush_done()
1093 if (atomic_cmpxchg(&tx_queue->flush_outstanding, 1, 0)) in efx_farch_handle_tx_flush_done()
1094 efx_farch_magic_event(tx_queue->channel, in efx_farch_handle_tx_flush_done()
1095 EFX_CHANNEL_MAGIC_TX_DRAIN(tx_queue)); in efx_farch_handle_tx_flush_done()