Lines Matching refs:txq
180 #define MVPP2_TXQ_SENT_REG(txq) (0x3c00 + 4 * (txq)) argument
1333 unsigned int txq) in mvpp2_txdesc_txq_set() argument
1336 tx_desc->pp21.phys_txq = txq; in mvpp2_txdesc_txq_set()
1338 tx_desc->pp22.phys_txq = txq; in mvpp2_txdesc_txq_set()
1411 static inline int mvpp2_txq_phys(int port, int txq) in mvpp2_txq_phys() argument
1413 return (MVPP2_MAX_TCONT + port) * MVPP2_MAX_TXQ + txq; in mvpp2_txq_phys()
3804 struct mvpp2_tx_queue *txq = port->txqs[queue]; in mvpp2_egress_enable() local
3806 if (txq->descs != NULL) in mvpp2_egress_enable()
3925 struct mvpp2_tx_queue *txq) in mvpp2_txq_pend_desc_num_get() argument
3929 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_pend_desc_num_get()
3937 mvpp2_txq_next_desc_get(struct mvpp2_tx_queue *txq) in mvpp2_txq_next_desc_get() argument
3939 int tx_desc = txq->next_desc_to_proc; in mvpp2_txq_next_desc_get()
3941 txq->next_desc_to_proc = MVPP2_QUEUE_NEXT_DESC(txq, tx_desc); in mvpp2_txq_next_desc_get()
3942 return txq->descs + tx_desc; in mvpp2_txq_next_desc_get()
3957 struct mvpp2_tx_queue *txq) in mvpp2_txq_sent_desc_proc() argument
3962 val = mvpp2_read(port->priv, MVPP2_TXQ_SENT_REG(txq->id)); in mvpp2_txq_sent_desc_proc()
3984 int txq, tx_port_num; in mvpp2_txp_max_tx_size_set() local
4013 for (txq = 0; txq < txq_number; txq++) { in mvpp2_txp_max_tx_size_set()
4015 MVPP2_TXQ_SCHED_TOKEN_SIZE_REG(txq)); in mvpp2_txp_max_tx_size_set()
4023 MVPP2_TXQ_SCHED_TOKEN_SIZE_REG(txq), in mvpp2_txp_max_tx_size_set()
4031 struct mvpp2_tx_queue *txq, in mvpp2_txq_bufs_free() argument
4182 struct mvpp2_tx_queue *txq) in mvpp2_txq_init() argument
4188 txq->size = port->tx_ring_size; in mvpp2_txq_init()
4191 txq->descs = buffer_loc.tx_descs; in mvpp2_txq_init()
4192 txq->descs_dma = (dma_addr_t)buffer_loc.tx_descs; in mvpp2_txq_init()
4193 if (!txq->descs) in mvpp2_txq_init()
4197 BUG_ON(txq->descs != in mvpp2_txq_init()
4198 PTR_ALIGN(txq->descs, MVPP2_CPU_D_CACHE_LINE_SIZE)); in mvpp2_txq_init()
4200 txq->last_desc = txq->size - 1; in mvpp2_txq_init()
4203 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_init()
4204 mvpp2_write(port->priv, MVPP2_TXQ_DESC_ADDR_REG, txq->descs_dma); in mvpp2_txq_init()
4205 mvpp2_write(port->priv, MVPP2_TXQ_DESC_SIZE_REG, txq->size & in mvpp2_txq_init()
4209 txq->id << MVPP2_TXQ_RSVD_CLR_OFFSET); in mvpp2_txq_init()
4221 (txq->log_id * desc_per_txq); in mvpp2_txq_init()
4231 val = mvpp2_read(port->priv, MVPP2_TXQ_SCHED_REFILL_REG(txq->log_id)); in mvpp2_txq_init()
4235 mvpp2_write(port->priv, MVPP2_TXQ_SCHED_REFILL_REG(txq->log_id), val); in mvpp2_txq_init()
4238 mvpp2_write(port->priv, MVPP2_TXQ_SCHED_TOKEN_SIZE_REG(txq->log_id), in mvpp2_txq_init()
4242 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_init()
4243 txq_pcpu->size = txq->size; in mvpp2_txq_init()
4251 struct mvpp2_tx_queue *txq) in mvpp2_txq_deinit() argument
4253 txq->descs = NULL; in mvpp2_txq_deinit()
4254 txq->last_desc = 0; in mvpp2_txq_deinit()
4255 txq->next_desc_to_proc = 0; in mvpp2_txq_deinit()
4256 txq->descs_dma = 0; in mvpp2_txq_deinit()
4259 mvpp2_write(port->priv, MVPP2_TXQ_SCHED_TOKEN_CNTR_REG(txq->id), 0); in mvpp2_txq_deinit()
4262 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_deinit()
4268 static void mvpp2_txq_clean(struct mvpp2_port *port, struct mvpp2_tx_queue *txq) in mvpp2_txq_clean() argument
4274 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_txq_clean()
4287 port->id, txq->log_id); in mvpp2_txq_clean()
4293 pending = mvpp2_txq_pend_desc_num_get(port, txq); in mvpp2_txq_clean()
4300 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_txq_clean()
4303 mvpp2_txq_bufs_free(port, txq, txq_pcpu, txq_pcpu->count); in mvpp2_txq_clean()
4315 struct mvpp2_tx_queue *txq; in mvpp2_cleanup_txqs() local
4326 txq = port->txqs[queue]; in mvpp2_cleanup_txqs()
4327 mvpp2_txq_clean(port, txq); in mvpp2_cleanup_txqs()
4328 mvpp2_txq_deinit(port, txq); in mvpp2_cleanup_txqs()
4366 struct mvpp2_tx_queue *txq; in mvpp2_setup_txqs() local
4370 txq = port->txqs[queue]; in mvpp2_setup_txqs()
4371 err = mvpp2_txq_init(port, txq); in mvpp2_setup_txqs()
4644 struct mvpp2_tx_queue *txq; in mvpp2_port_init() local
4646 txq = devm_kzalloc(dev, sizeof(*txq), GFP_KERNEL); in mvpp2_port_init()
4647 if (!txq) in mvpp2_port_init()
4650 txq->pcpu = devm_kzalloc(dev, sizeof(struct mvpp2_txq_pcpu), in mvpp2_port_init()
4652 if (!txq->pcpu) in mvpp2_port_init()
4655 txq->id = queue_phy_id; in mvpp2_port_init()
4656 txq->log_id = queue; in mvpp2_port_init()
4657 txq->done_pkts_coal = MVPP2_TXDONE_COAL_PKTS_THRESH; in mvpp2_port_init()
4659 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); in mvpp2_port_init()
4663 port->txqs[queue] = txq; in mvpp2_port_init()
5257 struct mvpp2_tx_queue *txq, *aggr_txq; in mvpp2_send() local
5262 txq = port->txqs[0]; in mvpp2_send()
5267 mvpp2_txdesc_txq_set(port, tx_desc, txq->id); in mvpp2_send()
5286 mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id); in mvpp2_send()
5294 tx_done = mvpp2_txq_pend_desc_num_get(port, txq); in mvpp2_send()
5303 tx_done = mvpp2_txq_sent_desc_proc(port, txq); in mvpp2_send()