Lines Matching refs:tx_queue
834 struct efx_tx_queue *tx_queue; in efx_ef10_link_piobufs() local
864 efx_for_each_channel_tx_queue(tx_queue, channel) { in efx_ef10_link_piobufs()
870 tx_queue->channel->channel - 1) * in efx_ef10_link_piobufs()
880 if (tx_queue->queue == nic_data->pio_write_vi_base) { in efx_ef10_link_piobufs()
889 tx_queue->queue); in efx_ef10_link_piobufs()
901 tx_queue->queue, index, rc); in efx_ef10_link_piobufs()
902 tx_queue->piobuf = NULL; in efx_ef10_link_piobufs()
904 tx_queue->piobuf = in efx_ef10_link_piobufs()
907 tx_queue->piobuf_offset = offset; in efx_ef10_link_piobufs()
910 tx_queue->queue, index, in efx_ef10_link_piobufs()
911 tx_queue->piobuf_offset, in efx_ef10_link_piobufs()
912 tx_queue->piobuf); in efx_ef10_link_piobufs()
937 struct efx_tx_queue *tx_queue; in efx_ef10_forget_old_piobufs() local
941 efx_for_each_channel_tx_queue(tx_queue, channel) in efx_ef10_forget_old_piobufs()
942 tx_queue->piobuf = NULL; in efx_ef10_forget_old_piobufs()
2137 static int efx_ef10_tx_probe(struct efx_tx_queue *tx_queue) in efx_ef10_tx_probe() argument
2139 return efx_nic_alloc_buffer(tx_queue->efx, &tx_queue->txd.buf, in efx_ef10_tx_probe()
2140 (tx_queue->ptr_mask + 1) * in efx_ef10_tx_probe()
2146 static inline void efx_ef10_push_tx_desc(struct efx_tx_queue *tx_queue, in efx_ef10_push_tx_desc() argument
2152 write_ptr = tx_queue->write_count & tx_queue->ptr_mask; in efx_ef10_push_tx_desc()
2155 efx_writeo_page(tx_queue->efx, ®, in efx_ef10_push_tx_desc()
2156 ER_DZ_TX_DESC_UPD, tx_queue->queue); in efx_ef10_push_tx_desc()
2161 static int efx_ef10_tx_tso_desc(struct efx_tx_queue *tx_queue, in efx_ef10_tx_tso_desc() argument
2173 EFX_WARN_ON_ONCE_PARANOID(tx_queue->tso_version != 2); in efx_ef10_tx_tso_desc()
2199 buffer = efx_tx_queue_get_insert_buffer(tx_queue); in efx_ef10_tx_tso_desc()
2212 ++tx_queue->insert_count; in efx_ef10_tx_tso_desc()
2214 buffer = efx_tx_queue_get_insert_buffer(tx_queue); in efx_ef10_tx_tso_desc()
2226 ++tx_queue->insert_count; in efx_ef10_tx_tso_desc()
2245 static void efx_ef10_tx_init(struct efx_tx_queue *tx_queue) in efx_ef10_tx_init() argument
2249 bool csum_offload = tx_queue->queue & EFX_TXQ_TYPE_OFFLOAD; in efx_ef10_tx_init()
2250 size_t entries = tx_queue->txd.buf.len / EFX_BUF_SIZE; in efx_ef10_tx_init()
2251 struct efx_channel *channel = tx_queue->channel; in efx_ef10_tx_init()
2252 struct efx_nic *efx = tx_queue->efx; in efx_ef10_tx_init()
2273 MCDI_SET_DWORD(inbuf, INIT_TXQ_IN_SIZE, tx_queue->ptr_mask + 1); in efx_ef10_tx_init()
2275 MCDI_SET_DWORD(inbuf, INIT_TXQ_IN_LABEL, tx_queue->queue); in efx_ef10_tx_init()
2276 MCDI_SET_DWORD(inbuf, INIT_TXQ_IN_INSTANCE, tx_queue->queue); in efx_ef10_tx_init()
2280 dma_addr = tx_queue->txd.buf.dma_addr; in efx_ef10_tx_init()
2283 tx_queue->queue, entries, (u64)dma_addr); in efx_ef10_tx_init()
2323 tx_queue->buffer[0].flags = EFX_TX_BUF_OPTION; in efx_ef10_tx_init()
2324 tx_queue->insert_count = 1; in efx_ef10_tx_init()
2325 txd = efx_tx_desc(tx_queue, 0); in efx_ef10_tx_init()
2332 tx_queue->write_count = 1; in efx_ef10_tx_init()
2335 tx_queue->handle_tso = efx_ef10_tx_tso_desc; in efx_ef10_tx_init()
2336 tx_queue->tso_version = 2; in efx_ef10_tx_init()
2339 tx_queue->tso_version = 1; in efx_ef10_tx_init()
2343 efx_ef10_push_tx_desc(tx_queue, txd); in efx_ef10_tx_init()
2349 tx_queue->queue); in efx_ef10_tx_init()
2352 static void efx_ef10_tx_fini(struct efx_tx_queue *tx_queue) in efx_ef10_tx_fini() argument
2356 struct efx_nic *efx = tx_queue->efx; in efx_ef10_tx_fini()
2361 tx_queue->queue); in efx_ef10_tx_fini()
2376 static void efx_ef10_tx_remove(struct efx_tx_queue *tx_queue) in efx_ef10_tx_remove() argument
2378 efx_nic_free_buffer(tx_queue->efx, &tx_queue->txd.buf); in efx_ef10_tx_remove()
2382 static inline void efx_ef10_notify_tx_desc(struct efx_tx_queue *tx_queue) in efx_ef10_notify_tx_desc() argument
2387 write_ptr = tx_queue->write_count & tx_queue->ptr_mask; in efx_ef10_notify_tx_desc()
2389 efx_writed_page(tx_queue->efx, ®, in efx_ef10_notify_tx_desc()
2390 ER_DZ_TX_DESC_UPD_DWORD, tx_queue->queue); in efx_ef10_notify_tx_desc()
2395 static unsigned int efx_ef10_tx_limit_len(struct efx_tx_queue *tx_queue, in efx_ef10_tx_limit_len() argument
2412 static void efx_ef10_tx_write(struct efx_tx_queue *tx_queue) in efx_ef10_tx_write() argument
2414 unsigned int old_write_count = tx_queue->write_count; in efx_ef10_tx_write()
2419 tx_queue->xmit_more_available = false; in efx_ef10_tx_write()
2420 if (unlikely(tx_queue->write_count == tx_queue->insert_count)) in efx_ef10_tx_write()
2424 write_ptr = tx_queue->write_count & tx_queue->ptr_mask; in efx_ef10_tx_write()
2425 buffer = &tx_queue->buffer[write_ptr]; in efx_ef10_tx_write()
2426 txd = efx_tx_desc(tx_queue, write_ptr); in efx_ef10_tx_write()
2427 ++tx_queue->write_count; in efx_ef10_tx_write()
2434 tx_queue->packet_write_count = tx_queue->write_count; in efx_ef10_tx_write()
2436 tx_queue->packet_write_count = tx_queue->write_count; in efx_ef10_tx_write()
2445 } while (tx_queue->write_count != tx_queue->insert_count); in efx_ef10_tx_write()
2449 if (efx_nic_may_push_tx_desc(tx_queue, old_write_count)) { in efx_ef10_tx_write()
2450 txd = efx_tx_desc(tx_queue, in efx_ef10_tx_write()
2451 old_write_count & tx_queue->ptr_mask); in efx_ef10_tx_write()
2452 efx_ef10_push_tx_desc(tx_queue, txd); in efx_ef10_tx_write()
2453 ++tx_queue->pushes; in efx_ef10_tx_write()
2455 efx_ef10_notify_tx_desc(tx_queue); in efx_ef10_tx_write()
3426 struct efx_tx_queue *tx_queue; in efx_ef10_handle_tx_event() local
3440 tx_queue = efx_channel_get_tx_queue(channel, in efx_ef10_handle_tx_event()
3442 tx_descs = ((tx_ev_desc_ptr + 1 - tx_queue->read_count) & in efx_ef10_handle_tx_event()
3443 tx_queue->ptr_mask); in efx_ef10_handle_tx_event()
3444 efx_xmit_done(tx_queue, tx_ev_desc_ptr & tx_queue->ptr_mask); in efx_ef10_handle_tx_event()
3655 struct efx_tx_queue *tx_queue; in efx_ef10_fini_dmaq() local
3672 efx_for_each_channel_tx_queue(tx_queue, channel) in efx_ef10_fini_dmaq()
3673 efx_ef10_tx_fini(tx_queue); in efx_ef10_fini_dmaq()