Lines Matching refs:txq_pcpu

266 static void mvpp2_txq_inc_get(struct mvpp2_txq_pcpu *txq_pcpu)  in mvpp2_txq_inc_get()  argument
268 txq_pcpu->txq_get_index++; in mvpp2_txq_inc_get()
269 if (txq_pcpu->txq_get_index == txq_pcpu->size) in mvpp2_txq_inc_get()
270 txq_pcpu->txq_get_index = 0; in mvpp2_txq_inc_get()
274 struct mvpp2_txq_pcpu *txq_pcpu, in mvpp2_txq_inc_put() argument
279 txq_pcpu->buffs + txq_pcpu->txq_put_index; in mvpp2_txq_inc_put()
284 txq_pcpu->txq_put_index++; in mvpp2_txq_inc_put()
285 if (txq_pcpu->txq_put_index == txq_pcpu->size) in mvpp2_txq_inc_put()
286 txq_pcpu->txq_put_index = 0; in mvpp2_txq_inc_put()
1679 struct mvpp2_txq_pcpu *txq_pcpu, in mvpp2_txq_reserved_desc_num_proc() argument
1684 if (txq_pcpu->reserved_num >= num) in mvpp2_txq_reserved_desc_num_proc()
1701 req = max(MVPP2_CPU_DESC_CHUNK, num - txq_pcpu->reserved_num); in mvpp2_txq_reserved_desc_num_proc()
1708 txq_pcpu->reserved_num += mvpp2_txq_alloc_reserved_desc(priv, txq, req); in mvpp2_txq_reserved_desc_num_proc()
1711 if (txq_pcpu->reserved_num < num) in mvpp2_txq_reserved_desc_num_proc()
1936 struct mvpp2_txq_pcpu *txq_pcpu, int num) in mvpp2_txq_bufs_free() argument
1942 txq_pcpu->buffs + txq_pcpu->txq_get_index; in mvpp2_txq_bufs_free()
1944 if (!IS_TSO_HEADER(txq_pcpu, tx_buf->dma)) in mvpp2_txq_bufs_free()
1950 mvpp2_txq_inc_get(txq_pcpu); in mvpp2_txq_bufs_free()
1972 struct mvpp2_txq_pcpu *txq_pcpu) in mvpp2_txq_done() argument
1977 if (txq_pcpu->cpu != smp_processor_id()) in mvpp2_txq_done()
1983 mvpp2_txq_bufs_free(port, txq, txq_pcpu, tx_done); in mvpp2_txq_done()
1985 txq_pcpu->count -= tx_done; in mvpp2_txq_done()
1988 if (txq_pcpu->count <= txq_pcpu->wake_threshold) in mvpp2_txq_done()
1996 struct mvpp2_txq_pcpu *txq_pcpu; in mvpp2_tx_done() local
2004 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_tx_done()
2006 if (txq_pcpu->count) { in mvpp2_tx_done()
2007 mvpp2_txq_done(port, txq, txq_pcpu); in mvpp2_tx_done()
2008 tx_todo += txq_pcpu->count; in mvpp2_tx_done()
2162 struct mvpp2_txq_pcpu *txq_pcpu; in mvpp2_txq_init() local
2218 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_init()
2219 txq_pcpu->size = txq->size; in mvpp2_txq_init()
2220 txq_pcpu->buffs = kmalloc_array(txq_pcpu->size, in mvpp2_txq_init()
2221 sizeof(*txq_pcpu->buffs), in mvpp2_txq_init()
2223 if (!txq_pcpu->buffs) in mvpp2_txq_init()
2226 txq_pcpu->count = 0; in mvpp2_txq_init()
2227 txq_pcpu->reserved_num = 0; in mvpp2_txq_init()
2228 txq_pcpu->txq_put_index = 0; in mvpp2_txq_init()
2229 txq_pcpu->txq_get_index = 0; in mvpp2_txq_init()
2230 txq_pcpu->tso_headers = NULL; in mvpp2_txq_init()
2232 txq_pcpu->stop_threshold = txq->size - MVPP2_MAX_SKB_DESCS; in mvpp2_txq_init()
2233 txq_pcpu->wake_threshold = txq_pcpu->stop_threshold / 2; in mvpp2_txq_init()
2235 txq_pcpu->tso_headers = in mvpp2_txq_init()
2237 txq_pcpu->size * TSO_HEADER_SIZE, in mvpp2_txq_init()
2238 &txq_pcpu->tso_headers_dma, in mvpp2_txq_init()
2240 if (!txq_pcpu->tso_headers) in mvpp2_txq_init()
2251 struct mvpp2_txq_pcpu *txq_pcpu; in mvpp2_txq_deinit() local
2255 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_deinit()
2256 kfree(txq_pcpu->buffs); in mvpp2_txq_deinit()
2258 if (txq_pcpu->tso_headers) in mvpp2_txq_deinit()
2260 txq_pcpu->size * TSO_HEADER_SIZE, in mvpp2_txq_deinit()
2261 txq_pcpu->tso_headers, in mvpp2_txq_deinit()
2262 txq_pcpu->tso_headers_dma); in mvpp2_txq_deinit()
2264 txq_pcpu->tso_headers = NULL; in mvpp2_txq_deinit()
2291 struct mvpp2_txq_pcpu *txq_pcpu; in mvpp2_txq_clean() local
2325 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_clean()
2328 mvpp2_txq_bufs_free(port, txq, txq_pcpu, txq_pcpu->count); in mvpp2_txq_clean()
2331 txq_pcpu->count = 0; in mvpp2_txq_clean()
2332 txq_pcpu->txq_put_index = 0; in mvpp2_txq_clean()
2333 txq_pcpu->txq_get_index = 0; in mvpp2_txq_clean()
2732 struct mvpp2_txq_pcpu *txq_pcpu = this_cpu_ptr(txq->pcpu); in tx_desc_unmap_put() local
2738 if (!IS_TSO_HEADER(txq_pcpu, buf_dma_addr)) in tx_desc_unmap_put()
2749 struct mvpp2_txq_pcpu *txq_pcpu = this_cpu_ptr(txq->pcpu); in mvpp2_tx_frag_process() local
2775 mvpp2_txq_inc_put(port, txq_pcpu, skb, tx_desc); in mvpp2_tx_frag_process()
2779 mvpp2_txq_inc_put(port, txq_pcpu, NULL, tx_desc); in mvpp2_tx_frag_process()
2800 struct mvpp2_txq_pcpu *txq_pcpu, in mvpp2_tso_put_hdr() argument
2810 addr = txq_pcpu->tso_headers_dma + in mvpp2_tso_put_hdr()
2811 txq_pcpu->txq_put_index * TSO_HEADER_SIZE; in mvpp2_tso_put_hdr()
2817 mvpp2_txq_inc_put(port, txq_pcpu, NULL, tx_desc); in mvpp2_tso_put_hdr()
2824 struct mvpp2_txq_pcpu *txq_pcpu, in mvpp2_tso_put_data() argument
2846 mvpp2_txq_inc_put(port, txq_pcpu, skb, tx_desc); in mvpp2_tso_put_data()
2853 mvpp2_txq_inc_put(port, txq_pcpu, NULL, tx_desc); in mvpp2_tso_put_data()
2860 struct mvpp2_txq_pcpu *txq_pcpu) in mvpp2_tx_tso() argument
2870 mvpp2_txq_reserved_desc_num_proc(port->priv, txq, txq_pcpu, in mvpp2_tx_tso()
2878 char *hdr = txq_pcpu->tso_headers + in mvpp2_tx_tso()
2879 txq_pcpu->txq_put_index * TSO_HEADER_SIZE; in mvpp2_tx_tso()
2885 mvpp2_tso_put_hdr(skb, dev, txq, aggr_txq, txq_pcpu, hdr_sz); in mvpp2_tx_tso()
2893 txq_pcpu, sz, left, len == 0)) in mvpp2_tx_tso()
2914 struct mvpp2_txq_pcpu *txq_pcpu; in mvpp2_tx() local
2923 txq_pcpu = this_cpu_ptr(txq->pcpu); in mvpp2_tx()
2927 frags = mvpp2_tx_tso(skb, dev, txq, aggr_txq, txq_pcpu); in mvpp2_tx()
2935 txq_pcpu, frags)) { in mvpp2_tx()
2961 mvpp2_txq_inc_put(port, txq_pcpu, skb, tx_desc); in mvpp2_tx()
2966 mvpp2_txq_inc_put(port, txq_pcpu, NULL, tx_desc); in mvpp2_tx()
2980 txq_pcpu->reserved_num -= frags; in mvpp2_tx()
2981 txq_pcpu->count += frags; in mvpp2_tx()
2988 if (txq_pcpu->count >= txq_pcpu->stop_threshold) in mvpp2_tx()
3001 if (!port->has_tx_irqs && txq_pcpu->count >= txq->done_pkts_coal) in mvpp2_tx()
3002 mvpp2_txq_done(port, txq, txq_pcpu); in mvpp2_tx()
3005 if (!port->has_tx_irqs && txq_pcpu->count <= frags && in mvpp2_tx()
3006 txq_pcpu->count > 0) { in mvpp2_tx()
4090 struct mvpp2_txq_pcpu *txq_pcpu; in mvpp2_port_init() local
4136 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_port_init()
4137 txq_pcpu->cpu = cpu; in mvpp2_port_init()