Lines Matching refs:txq

131 #define MVPP2_TXQ_SENT_REG(txq)			(0x3c00 + 4 * (txq))  argument
981 static inline int mvpp2_txq_phys(int port, int txq) in mvpp2_txq_phys() argument
983 return (MVPP2_MAX_TCONT + port) * MVPP2_MAX_TXQ + txq; in mvpp2_txq_phys()
4016 struct mvpp2_tx_queue *txq = port->txqs[queue]; in mvpp2_egress_enable() local
4018 if (txq->descs != NULL) in mvpp2_egress_enable()
4133 struct mvpp2_tx_queue *txq) in mvpp2_txq_pend_desc_num_get() argument
4137 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_pend_desc_num_get()
4145 mvpp2_txq_next_desc_get(struct mvpp2_tx_queue *txq) in mvpp2_txq_next_desc_get() argument
4147 int tx_desc = txq->next_desc_to_proc; in mvpp2_txq_next_desc_get()
4149 txq->next_desc_to_proc = MVPP2_QUEUE_NEXT_DESC(txq, tx_desc); in mvpp2_txq_next_desc_get()
4150 return txq->descs + tx_desc; in mvpp2_txq_next_desc_get()
4183 struct mvpp2_tx_queue *txq, int num) in mvpp2_txq_alloc_reserved_desc() argument
4187 val = (txq->id << MVPP2_TXQ_RSVD_REQ_Q_OFFSET) | num; in mvpp2_txq_alloc_reserved_desc()
4199 struct mvpp2_tx_queue *txq, in mvpp2_txq_reserved_desc_num_proc() argument
4217 txq_pcpu_aux = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_reserved_desc_num_proc()
4226 (txq->size - (num_present_cpus() * MVPP2_CPU_DESC_CHUNK))) in mvpp2_txq_reserved_desc_num_proc()
4229 txq_pcpu->reserved_num += mvpp2_txq_alloc_reserved_desc(priv, txq, req); in mvpp2_txq_reserved_desc_num_proc()
4240 static void mvpp2_txq_desc_put(struct mvpp2_tx_queue *txq) in mvpp2_txq_desc_put() argument
4242 if (txq->next_desc_to_proc == 0) in mvpp2_txq_desc_put()
4243 txq->next_desc_to_proc = txq->last_desc - 1; in mvpp2_txq_desc_put()
4245 txq->next_desc_to_proc--; in mvpp2_txq_desc_put()
4286 struct mvpp2_tx_queue *txq) in mvpp2_txq_sent_desc_proc() argument
4291 val = mvpp2_read(port->priv, MVPP2_TXQ_SENT_REG(txq->id)); in mvpp2_txq_sent_desc_proc()
4313 int txq, tx_port_num; in mvpp2_txp_max_tx_size_set() local
4342 for (txq = 0; txq < txq_number; txq++) { in mvpp2_txp_max_tx_size_set()
4344 MVPP2_TXQ_SCHED_TOKEN_SIZE_REG(txq)); in mvpp2_txp_max_tx_size_set()
4352 MVPP2_TXQ_SCHED_TOKEN_SIZE_REG(txq), in mvpp2_txp_max_tx_size_set()
4393 struct mvpp2_tx_queue *txq = port->txqs[queue]; in mvpp2_tx_done_pkts_coal_set() local
4395 val = (txq->done_pkts_coal << MVPP2_TRANSMITTED_THRESH_OFFSET) & in mvpp2_tx_done_pkts_coal_set()
4397 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_tx_done_pkts_coal_set()
4404 struct mvpp2_tx_queue *txq, in mvpp2_txq_bufs_free() argument
4410 struct mvpp2_tx_desc *tx_desc = txq->descs + in mvpp2_txq_bufs_free()
4442 static void mvpp2_txq_done(struct mvpp2_port *port, struct mvpp2_tx_queue *txq, in mvpp2_txq_done() argument
4445 struct netdev_queue *nq = netdev_get_tx_queue(port->dev, txq->log_id); in mvpp2_txq_done()
4451 tx_done = mvpp2_txq_sent_desc_proc(port, txq); in mvpp2_txq_done()
4454 mvpp2_txq_bufs_free(port, txq, txq_pcpu, tx_done); in mvpp2_txq_done()
4586 struct mvpp2_tx_queue *txq) in mvpp2_txq_init() argument
4592 txq->size = port->tx_ring_size; in mvpp2_txq_init()
4595 txq->descs = dma_alloc_coherent(port->dev->dev.parent, in mvpp2_txq_init()
4596 txq->size * MVPP2_DESC_ALIGNED_SIZE, in mvpp2_txq_init()
4597 &txq->descs_phys, GFP_KERNEL); in mvpp2_txq_init()
4598 if (!txq->descs) in mvpp2_txq_init()
4602 BUG_ON(txq->descs != in mvpp2_txq_init()
4603 PTR_ALIGN(txq->descs, MVPP2_CPU_D_CACHE_LINE_SIZE)); in mvpp2_txq_init()
4605 txq->last_desc = txq->size - 1; in mvpp2_txq_init()
4608 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_init()
4609 mvpp2_write(port->priv, MVPP2_TXQ_DESC_ADDR_REG, txq->descs_phys); in mvpp2_txq_init()
4610 mvpp2_write(port->priv, MVPP2_TXQ_DESC_SIZE_REG, txq->size & in mvpp2_txq_init()
4614 txq->id << MVPP2_TXQ_RSVD_CLR_OFFSET); in mvpp2_txq_init()
4626 (txq->log_id * desc_per_txq); in mvpp2_txq_init()
4636 val = mvpp2_read(port->priv, MVPP2_TXQ_SCHED_REFILL_REG(txq->log_id)); in mvpp2_txq_init()
4640 mvpp2_write(port->priv, MVPP2_TXQ_SCHED_REFILL_REG(txq->log_id), val); in mvpp2_txq_init()
4643 mvpp2_write(port->priv, MVPP2_TXQ_SCHED_TOKEN_SIZE_REG(txq->log_id), in mvpp2_txq_init()
4647 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_init()
4648 txq_pcpu->size = txq->size; in mvpp2_txq_init()
4654 txq->size * MVPP2_DESC_ALIGNED_SIZE, in mvpp2_txq_init()
4655 txq->descs, txq->descs_phys); in mvpp2_txq_init()
4670 struct mvpp2_tx_queue *txq) in mvpp2_txq_deinit() argument
4676 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_deinit()
4680 if (txq->descs) in mvpp2_txq_deinit()
4682 txq->size * MVPP2_DESC_ALIGNED_SIZE, in mvpp2_txq_deinit()
4683 txq->descs, txq->descs_phys); in mvpp2_txq_deinit()
4685 txq->descs = NULL; in mvpp2_txq_deinit()
4686 txq->last_desc = 0; in mvpp2_txq_deinit()
4687 txq->next_desc_to_proc = 0; in mvpp2_txq_deinit()
4688 txq->descs_phys = 0; in mvpp2_txq_deinit()
4691 mvpp2_write(port->priv, MVPP2_TXQ_SCHED_TOKEN_CNTR_REG(txq->id), 0); in mvpp2_txq_deinit()
4694 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_deinit()
4700 static void mvpp2_txq_clean(struct mvpp2_port *port, struct mvpp2_tx_queue *txq) in mvpp2_txq_clean() argument
4706 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_clean()
4719 port->id, txq->log_id); in mvpp2_txq_clean()
4725 pending = mvpp2_txq_pend_desc_num_get(port, txq); in mvpp2_txq_clean()
4732 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_clean()
4735 mvpp2_txq_bufs_free(port, txq, txq_pcpu, txq_pcpu->count); in mvpp2_txq_clean()
4747 struct mvpp2_tx_queue *txq; in mvpp2_cleanup_txqs() local
4758 txq = port->txqs[queue]; in mvpp2_cleanup_txqs()
4759 mvpp2_txq_clean(port, txq); in mvpp2_cleanup_txqs()
4760 mvpp2_txq_deinit(port, txq); in mvpp2_cleanup_txqs()
4798 struct mvpp2_tx_queue *txq; in mvpp2_setup_txqs() local
4802 txq = port->txqs[queue]; in mvpp2_setup_txqs()
4803 err = mvpp2_txq_init(port, txq); in mvpp2_setup_txqs()
5107 tx_desc_unmap_put(struct device *dev, struct mvpp2_tx_queue *txq, in tx_desc_unmap_put() argument
5112 mvpp2_txq_desc_put(txq); in tx_desc_unmap_put()
5118 struct mvpp2_tx_queue *txq) in mvpp2_tx_frag_process() argument
5120 struct mvpp2_txq_pcpu *txq_pcpu = this_cpu_ptr(txq->pcpu); in mvpp2_tx_frag_process()
5130 tx_desc->phys_txq = txq->id; in mvpp2_tx_frag_process()
5137 mvpp2_txq_desc_put(txq); in mvpp2_tx_frag_process()
5162 tx_desc = txq->descs + i; in mvpp2_tx_frag_process()
5163 tx_desc_unmap_put(port->dev->dev.parent, txq, tx_desc); in mvpp2_tx_frag_process()
5173 struct mvpp2_tx_queue *txq, *aggr_txq; in mvpp2_tx() local
5182 txq = port->txqs[txq_id]; in mvpp2_tx()
5183 txq_pcpu = this_cpu_ptr(txq->pcpu); in mvpp2_tx()
5190 mvpp2_txq_reserved_desc_num_proc(port->priv, txq, in mvpp2_tx()
5198 tx_desc->phys_txq = txq->id; in mvpp2_tx()
5204 mvpp2_txq_desc_put(txq); in mvpp2_tx()
5225 if (mvpp2_tx_frag_process(port, skb, aggr_txq, txq)) { in mvpp2_tx()
5226 tx_desc_unmap_put(port->dev->dev.parent, txq, tx_desc); in mvpp2_tx()
5302 struct mvpp2_tx_queue *txq = mvpp2_get_tx_queue(port, cause_tx); in mvpp2_txq_done_percpu() local
5303 struct mvpp2_txq_pcpu *txq_pcpu = this_cpu_ptr(txq->pcpu); in mvpp2_txq_done_percpu()
5306 mvpp2_txq_done(port, txq, txq_pcpu); in mvpp2_txq_done_percpu()
5782 struct mvpp2_tx_queue *txq = port->txqs[queue]; in mvpp2_ethtool_set_coalesce() local
5784 txq->done_pkts_coal = c->tx_max_coalesced_frames; in mvpp2_ethtool_set_coalesce()
5944 struct mvpp2_tx_queue *txq; in mvpp2_port_init() local
5946 txq = devm_kzalloc(dev, sizeof(*txq), GFP_KERNEL); in mvpp2_port_init()
5947 if (!txq) in mvpp2_port_init()
5950 txq->pcpu = alloc_percpu(struct mvpp2_txq_pcpu); in mvpp2_port_init()
5951 if (!txq->pcpu) { in mvpp2_port_init()
5956 txq->id = queue_phy_id; in mvpp2_port_init()
5957 txq->log_id = queue; in mvpp2_port_init()
5958 txq->done_pkts_coal = MVPP2_TXDONE_COAL_PKTS_THRESH; in mvpp2_port_init()
5960 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_port_init()
5964 port->txqs[queue] = txq; in mvpp2_port_init()