Lines Matching refs:txq

133 #define MVPP2_TXQ_SENT_REG(txq)			(0x3c00 + 4 * (txq))  argument
1000 static inline int mvpp2_txq_phys(int port, int txq) in mvpp2_txq_phys() argument
1002 return (MVPP2_MAX_TCONT + port) * MVPP2_MAX_TXQ + txq; in mvpp2_txq_phys()
4029 struct mvpp2_tx_queue *txq = port->txqs[queue]; in mvpp2_egress_enable() local
4031 if (txq->descs != NULL) in mvpp2_egress_enable()
4146 struct mvpp2_tx_queue *txq) in mvpp2_txq_pend_desc_num_get() argument
4150 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_pend_desc_num_get()
4158 mvpp2_txq_next_desc_get(struct mvpp2_tx_queue *txq) in mvpp2_txq_next_desc_get() argument
4160 int tx_desc = txq->next_desc_to_proc; in mvpp2_txq_next_desc_get()
4162 txq->next_desc_to_proc = MVPP2_QUEUE_NEXT_DESC(txq, tx_desc); in mvpp2_txq_next_desc_get()
4163 return txq->descs + tx_desc; in mvpp2_txq_next_desc_get()
4196 struct mvpp2_tx_queue *txq, int num) in mvpp2_txq_alloc_reserved_desc() argument
4200 val = (txq->id << MVPP2_TXQ_RSVD_REQ_Q_OFFSET) | num; in mvpp2_txq_alloc_reserved_desc()
4212 struct mvpp2_tx_queue *txq, in mvpp2_txq_reserved_desc_num_proc() argument
4230 txq_pcpu_aux = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_reserved_desc_num_proc()
4239 (txq->size - (num_present_cpus() * MVPP2_CPU_DESC_CHUNK))) in mvpp2_txq_reserved_desc_num_proc()
4242 txq_pcpu->reserved_num += mvpp2_txq_alloc_reserved_desc(priv, txq, req); in mvpp2_txq_reserved_desc_num_proc()
4253 static void mvpp2_txq_desc_put(struct mvpp2_tx_queue *txq) in mvpp2_txq_desc_put() argument
4255 if (txq->next_desc_to_proc == 0) in mvpp2_txq_desc_put()
4256 txq->next_desc_to_proc = txq->last_desc - 1; in mvpp2_txq_desc_put()
4258 txq->next_desc_to_proc--; in mvpp2_txq_desc_put()
4299 struct mvpp2_tx_queue *txq) in mvpp2_txq_sent_desc_proc() argument
4304 val = mvpp2_read(port->priv, MVPP2_TXQ_SENT_REG(txq->id)); in mvpp2_txq_sent_desc_proc()
4326 int txq, tx_port_num; in mvpp2_txp_max_tx_size_set() local
4355 for (txq = 0; txq < txq_number; txq++) { in mvpp2_txp_max_tx_size_set()
4357 MVPP2_TXQ_SCHED_TOKEN_SIZE_REG(txq)); in mvpp2_txp_max_tx_size_set()
4365 MVPP2_TXQ_SCHED_TOKEN_SIZE_REG(txq), in mvpp2_txp_max_tx_size_set()
4400 struct mvpp2_tx_queue *txq, in mvpp2_txq_bufs_free() argument
4437 static void mvpp2_txq_done(struct mvpp2_port *port, struct mvpp2_tx_queue *txq, in mvpp2_txq_done() argument
4440 struct netdev_queue *nq = netdev_get_tx_queue(port->dev, txq->log_id); in mvpp2_txq_done()
4446 tx_done = mvpp2_txq_sent_desc_proc(port, txq); in mvpp2_txq_done()
4449 mvpp2_txq_bufs_free(port, txq, txq_pcpu, tx_done); in mvpp2_txq_done()
4460 struct mvpp2_tx_queue *txq; in mvpp2_tx_done() local
4465 txq = mvpp2_get_tx_queue(port, cause); in mvpp2_tx_done()
4466 if (!txq) in mvpp2_tx_done()
4469 txq_pcpu = this_cpu_ptr(txq->pcpu); in mvpp2_tx_done()
4472 mvpp2_txq_done(port, txq, txq_pcpu); in mvpp2_tx_done()
4476 cause &= ~(1 << txq->log_id); in mvpp2_tx_done()
4604 struct mvpp2_tx_queue *txq) in mvpp2_txq_init() argument
4610 txq->size = port->tx_ring_size; in mvpp2_txq_init()
4613 txq->descs = dma_alloc_coherent(port->dev->dev.parent, in mvpp2_txq_init()
4614 txq->size * MVPP2_DESC_ALIGNED_SIZE, in mvpp2_txq_init()
4615 &txq->descs_phys, GFP_KERNEL); in mvpp2_txq_init()
4616 if (!txq->descs) in mvpp2_txq_init()
4620 BUG_ON(txq->descs != in mvpp2_txq_init()
4621 PTR_ALIGN(txq->descs, MVPP2_CPU_D_CACHE_LINE_SIZE)); in mvpp2_txq_init()
4623 txq->last_desc = txq->size - 1; in mvpp2_txq_init()
4626 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_init()
4627 mvpp2_write(port->priv, MVPP2_TXQ_DESC_ADDR_REG, txq->descs_phys); in mvpp2_txq_init()
4628 mvpp2_write(port->priv, MVPP2_TXQ_DESC_SIZE_REG, txq->size & in mvpp2_txq_init()
4632 txq->id << MVPP2_TXQ_RSVD_CLR_OFFSET); in mvpp2_txq_init()
4644 (txq->log_id * desc_per_txq); in mvpp2_txq_init()
4654 val = mvpp2_read(port->priv, MVPP2_TXQ_SCHED_REFILL_REG(txq->log_id)); in mvpp2_txq_init()
4658 mvpp2_write(port->priv, MVPP2_TXQ_SCHED_REFILL_REG(txq->log_id), val); in mvpp2_txq_init()
4661 mvpp2_write(port->priv, MVPP2_TXQ_SCHED_TOKEN_SIZE_REG(txq->log_id), in mvpp2_txq_init()
4665 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_init()
4666 txq_pcpu->size = txq->size; in mvpp2_txq_init()
4688 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_init()
4694 txq->size * MVPP2_DESC_ALIGNED_SIZE, in mvpp2_txq_init()
4695 txq->descs, txq->descs_phys); in mvpp2_txq_init()
4702 struct mvpp2_tx_queue *txq) in mvpp2_txq_deinit() argument
4708 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_deinit()
4713 if (txq->descs) in mvpp2_txq_deinit()
4715 txq->size * MVPP2_DESC_ALIGNED_SIZE, in mvpp2_txq_deinit()
4716 txq->descs, txq->descs_phys); in mvpp2_txq_deinit()
4718 txq->descs = NULL; in mvpp2_txq_deinit()
4719 txq->last_desc = 0; in mvpp2_txq_deinit()
4720 txq->next_desc_to_proc = 0; in mvpp2_txq_deinit()
4721 txq->descs_phys = 0; in mvpp2_txq_deinit()
4724 mvpp2_write(port->priv, MVPP2_TXQ_SCHED_TOKEN_CNTR_REG(txq->id), 0); in mvpp2_txq_deinit()
4727 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_deinit()
4733 static void mvpp2_txq_clean(struct mvpp2_port *port, struct mvpp2_tx_queue *txq) in mvpp2_txq_clean() argument
4739 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_clean()
4752 port->id, txq->log_id); in mvpp2_txq_clean()
4758 pending = mvpp2_txq_pend_desc_num_get(port, txq); in mvpp2_txq_clean()
4765 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_clean()
4768 mvpp2_txq_bufs_free(port, txq, txq_pcpu, txq_pcpu->count); in mvpp2_txq_clean()
4780 struct mvpp2_tx_queue *txq; in mvpp2_cleanup_txqs() local
4791 txq = port->txqs[queue]; in mvpp2_cleanup_txqs()
4792 mvpp2_txq_clean(port, txq); in mvpp2_cleanup_txqs()
4793 mvpp2_txq_deinit(port, txq); in mvpp2_cleanup_txqs()
4831 struct mvpp2_tx_queue *txq; in mvpp2_setup_txqs() local
4835 txq = port->txqs[queue]; in mvpp2_setup_txqs()
4836 err = mvpp2_txq_init(port, txq); in mvpp2_setup_txqs()
5189 tx_desc_unmap_put(struct device *dev, struct mvpp2_tx_queue *txq, in tx_desc_unmap_put() argument
5194 mvpp2_txq_desc_put(txq); in tx_desc_unmap_put()
5200 struct mvpp2_tx_queue *txq) in mvpp2_tx_frag_process() argument
5202 struct mvpp2_txq_pcpu *txq_pcpu = this_cpu_ptr(txq->pcpu); in mvpp2_tx_frag_process()
5212 tx_desc->phys_txq = txq->id; in mvpp2_tx_frag_process()
5219 mvpp2_txq_desc_put(txq); in mvpp2_tx_frag_process()
5244 tx_desc = txq->descs + i; in mvpp2_tx_frag_process()
5245 tx_desc_unmap_put(port->dev->dev.parent, txq, tx_desc); in mvpp2_tx_frag_process()
5255 struct mvpp2_tx_queue *txq, *aggr_txq; in mvpp2_tx() local
5264 txq = port->txqs[txq_id]; in mvpp2_tx()
5265 txq_pcpu = this_cpu_ptr(txq->pcpu); in mvpp2_tx()
5272 mvpp2_txq_reserved_desc_num_proc(port->priv, txq, in mvpp2_tx()
5280 tx_desc->phys_txq = txq->id; in mvpp2_tx()
5286 mvpp2_txq_desc_put(txq); in mvpp2_tx()
5307 if (mvpp2_tx_frag_process(port, skb, aggr_txq, txq)) { in mvpp2_tx()
5308 tx_desc_unmap_put(port->dev->dev.parent, txq, tx_desc); in mvpp2_tx()
5341 if (txq_pcpu->count >= txq->done_pkts_coal) in mvpp2_tx()
5342 mvpp2_txq_done(port, txq, txq_pcpu); in mvpp2_tx()
5865 struct mvpp2_tx_queue *txq = port->txqs[queue]; in mvpp2_ethtool_set_coalesce() local
5867 txq->done_pkts_coal = c->tx_max_coalesced_frames; in mvpp2_ethtool_set_coalesce()
6026 struct mvpp2_tx_queue *txq; in mvpp2_port_init() local
6028 txq = devm_kzalloc(dev, sizeof(*txq), GFP_KERNEL); in mvpp2_port_init()
6029 if (!txq) in mvpp2_port_init()
6032 txq->pcpu = alloc_percpu(struct mvpp2_txq_pcpu); in mvpp2_port_init()
6033 if (!txq->pcpu) { in mvpp2_port_init()
6038 txq->id = queue_phy_id; in mvpp2_port_init()
6039 txq->log_id = queue; in mvpp2_port_init()
6040 txq->done_pkts_coal = MVPP2_TXDONE_COAL_PKTS_THRESH; in mvpp2_port_init()
6042 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_port_init()
6046 port->txqs[queue] = txq; in mvpp2_port_init()