Lines Matching refs:p_tx
301 struct qed_ll2_tx_queue *p_tx; in qed_ll2_txq_flush() local
309 p_tx = &p_ll2_conn->tx_queue; in qed_ll2_txq_flush()
311 spin_lock_irqsave(&p_tx->lock, flags); in qed_ll2_txq_flush()
312 while (!list_empty(&p_tx->active_descq)) { in qed_ll2_txq_flush()
313 p_pkt = list_first_entry(&p_tx->active_descq, in qed_ll2_txq_flush()
319 b_last_packet = list_empty(&p_tx->active_descq); in qed_ll2_txq_flush()
320 list_add_tail(&p_pkt->list_entry, &p_tx->free_descq); in qed_ll2_txq_flush()
321 spin_unlock_irqrestore(&p_tx->lock, flags); in qed_ll2_txq_flush()
329 p_tx->cur_completing_packet = *p_pkt; in qed_ll2_txq_flush()
330 p_tx->cur_completing_bd_idx = 1; in qed_ll2_txq_flush()
332 p_tx->cur_completing_bd_idx == p_pkt->bd_used; in qed_ll2_txq_flush()
341 spin_lock_irqsave(&p_tx->lock, flags); in qed_ll2_txq_flush()
343 spin_unlock_irqrestore(&p_tx->lock, flags); in qed_ll2_txq_flush()
349 struct qed_ll2_tx_queue *p_tx = &p_ll2_conn->tx_queue; in qed_ll2_txq_completion() local
356 spin_lock_irqsave(&p_tx->lock, flags); in qed_ll2_txq_completion()
357 if (p_tx->b_completing_packet) { in qed_ll2_txq_completion()
362 new_idx = le16_to_cpu(*p_tx->p_fw_cons); in qed_ll2_txq_completion()
363 num_bds = ((s16)new_idx - (s16)p_tx->bds_idx); in qed_ll2_txq_completion()
365 if (list_empty(&p_tx->active_descq)) in qed_ll2_txq_completion()
368 p_pkt = list_first_entry(&p_tx->active_descq, in qed_ll2_txq_completion()
373 p_tx->b_completing_packet = true; in qed_ll2_txq_completion()
374 p_tx->cur_completing_packet = *p_pkt; in qed_ll2_txq_completion()
385 p_tx->bds_idx += num_bds_in_packet; in qed_ll2_txq_completion()
387 qed_chain_consume(&p_tx->txq_chain); in qed_ll2_txq_completion()
389 p_tx->cur_completing_bd_idx = 1; in qed_ll2_txq_completion()
390 b_last_frag = p_tx->cur_completing_bd_idx == p_pkt->bd_used; in qed_ll2_txq_completion()
391 list_add_tail(&p_pkt->list_entry, &p_tx->free_descq); in qed_ll2_txq_completion()
393 spin_unlock_irqrestore(&p_tx->lock, flags); in qed_ll2_txq_completion()
401 spin_lock_irqsave(&p_tx->lock, flags); in qed_ll2_txq_completion()
404 p_tx->b_completing_packet = false; in qed_ll2_txq_completion()
407 spin_unlock_irqrestore(&p_tx->lock, flags); in qed_ll2_txq_completion()
866 struct qed_ll2_tx_queue *p_tx = &p_ll2_conn->tx_queue; in qed_ll2_lb_txq_completion() local
876 new_idx = le16_to_cpu(*p_tx->p_fw_cons); in qed_ll2_lb_txq_completion()
877 num_bds = ((s16)new_idx - (s16)p_tx->bds_idx); in qed_ll2_lb_txq_completion()
883 if (list_empty(&p_tx->active_descq)) in qed_ll2_lb_txq_completion()
886 p_pkt = list_first_entry(&p_tx->active_descq, in qed_ll2_lb_txq_completion()
901 p_tx->bds_idx++; in qed_ll2_lb_txq_completion()
902 qed_chain_consume(&p_tx->txq_chain); in qed_ll2_lb_txq_completion()
905 list_add_tail(&p_pkt->list_entry, &p_tx->free_descq); in qed_ll2_lb_txq_completion()
1006 struct qed_ll2_tx_queue *p_tx = &p_ll2_conn->tx_queue; in qed_sp_ll2_tx_queue_start() local
1036 p_ramrod->sb_index = p_tx->tx_sb_index; in qed_sp_ll2_tx_queue_start()
1042 qed_chain_get_pbl_phys(&p_tx->txq_chain)); in qed_sp_ll2_tx_queue_start()
1043 pbl_size = qed_chain_get_page_cnt(&p_tx->txq_chain); in qed_sp_ll2_tx_queue_start()
1090 rc = qed_db_recovery_add(p_hwfn->cdev, p_tx->doorbell_addr, in qed_sp_ll2_tx_queue_start()
1091 &p_tx->db_msg, DB_REC_WIDTH_32B, in qed_sp_ll2_tx_queue_start()
1127 struct qed_ll2_tx_queue *p_tx = &p_ll2_conn->tx_queue; in qed_sp_ll2_tx_queue_stop() local
1131 qed_db_recovery_del(p_hwfn->cdev, p_tx->doorbell_addr, &p_tx->db_msg); in qed_sp_ll2_tx_queue_stop()
1484 struct qed_ll2_tx_queue *p_tx; in qed_ll2_establish_connection() local
1502 p_tx = &p_ll2_conn->tx_queue; in qed_ll2_establish_connection()
1516 qed_chain_reset(&p_tx->txq_chain); in qed_ll2_establish_connection()
1517 INIT_LIST_HEAD(&p_tx->active_descq); in qed_ll2_establish_connection()
1518 INIT_LIST_HEAD(&p_tx->free_descq); in qed_ll2_establish_connection()
1519 INIT_LIST_HEAD(&p_tx->sending_descq); in qed_ll2_establish_connection()
1520 spin_lock_init(&p_tx->lock); in qed_ll2_establish_connection()
1521 capacity = qed_chain_get_capacity(&p_tx->txq_chain); in qed_ll2_establish_connection()
1528 p_pkt = p_tx->descq_mem + desc_size * i; in qed_ll2_establish_connection()
1529 list_add_tail(&p_pkt->list_entry, &p_tx->free_descq); in qed_ll2_establish_connection()
1531 p_tx->cur_completing_bd_idx = 0; in qed_ll2_establish_connection()
1532 p_tx->bds_idx = 0; in qed_ll2_establish_connection()
1533 p_tx->b_completing_packet = false; in qed_ll2_establish_connection()
1534 p_tx->cur_send_packet = NULL; in qed_ll2_establish_connection()
1535 p_tx->cur_send_frag_num = 0; in qed_ll2_establish_connection()
1536 p_tx->cur_completing_frag_num = 0; in qed_ll2_establish_connection()
1537 *p_tx->p_fw_cons = 0; in qed_ll2_establish_connection()
1549 p_tx->doorbell_addr = (u8 __iomem *)p_hwfn->doorbells + in qed_ll2_establish_connection()
1553 SET_FIELD(p_tx->db_msg.params, CORE_DB_DATA_DEST, DB_DEST_XCM); in qed_ll2_establish_connection()
1554 SET_FIELD(p_tx->db_msg.params, CORE_DB_DATA_AGG_CMD, DB_AGG_CMD_SET); in qed_ll2_establish_connection()
1555 SET_FIELD(p_tx->db_msg.params, CORE_DB_DATA_AGG_VAL_SEL, in qed_ll2_establish_connection()
1557 p_tx->db_msg.agg_flags = DQ_XCM_CORE_DQ_CF_CMD; in qed_ll2_establish_connection()
1689 struct qed_ll2_tx_queue *p_tx, in qed_ll2_prepare_tx_packet_set() argument
1698 p_tx->cur_send_packet = p_curp; in qed_ll2_prepare_tx_packet_set()
1699 p_tx->cur_send_frag_num = 0; in qed_ll2_prepare_tx_packet_set()
1701 p_curp->bds_set[p_tx->cur_send_frag_num].tx_frag = pkt->first_frag; in qed_ll2_prepare_tx_packet_set()
1702 p_curp->bds_set[p_tx->cur_send_frag_num].frag_len = pkt->first_frag_len; in qed_ll2_prepare_tx_packet_set()
1703 p_tx->cur_send_frag_num++; in qed_ll2_prepare_tx_packet_set()
1799 struct qed_ll2_tx_queue *p_tx = &p_ll2_conn->tx_queue; in qed_ll2_tx_packet_notify() local
1820 while (!list_empty(&p_tx->sending_descq)) { in qed_ll2_tx_packet_notify()
1821 p_pkt = list_first_entry(&p_tx->sending_descq, in qed_ll2_tx_packet_notify()
1826 list_move_tail(&p_pkt->list_entry, &p_tx->active_descq); in qed_ll2_tx_packet_notify()
1829 p_tx->db_msg.spq_prod = cpu_to_le16(bd_prod); in qed_ll2_tx_packet_notify()
1834 DIRECT_REG_WR(p_tx->doorbell_addr, *((u32 *)&p_tx->db_msg)); in qed_ll2_tx_packet_notify()
1841 p_ll2_conn->input.conn_type, p_tx->db_msg.spq_prod); in qed_ll2_tx_packet_notify()
1852 struct qed_ll2_tx_queue *p_tx; in qed_ll2_prepare_tx_packet() local
1860 p_tx = &p_ll2_conn->tx_queue; in qed_ll2_prepare_tx_packet()
1861 p_tx_chain = &p_tx->txq_chain; in qed_ll2_prepare_tx_packet()
1866 spin_lock_irqsave(&p_tx->lock, flags); in qed_ll2_prepare_tx_packet()
1867 if (p_tx->cur_send_packet) { in qed_ll2_prepare_tx_packet()
1873 if (!list_empty(&p_tx->free_descq)) in qed_ll2_prepare_tx_packet()
1874 p_curp = list_first_entry(&p_tx->free_descq, in qed_ll2_prepare_tx_packet()
1885 qed_ll2_prepare_tx_packet_set(p_hwfn, p_tx, p_curp, pkt, notify_fw); in qed_ll2_prepare_tx_packet()
1892 spin_unlock_irqrestore(&p_tx->lock, flags); in qed_ll2_prepare_tx_packet()