Lines Matching refs:p_ll2_conn
256 struct qed_ll2_info *p_ll2_conn, *p_ret = NULL; in __qed_ll2_handle_sanity() local
264 p_ll2_conn = &p_hwfn->p_ll2_info[connection_handle]; in __qed_ll2_handle_sanity()
268 mutex_lock(&p_ll2_conn->mutex); in __qed_ll2_handle_sanity()
269 if (p_ll2_conn->b_active) in __qed_ll2_handle_sanity()
270 p_ret = p_ll2_conn; in __qed_ll2_handle_sanity()
272 mutex_unlock(&p_ll2_conn->mutex); in __qed_ll2_handle_sanity()
274 p_ret = p_ll2_conn; in __qed_ll2_handle_sanity()
303 struct qed_ll2_info *p_ll2_conn; in qed_ll2_txq_flush() local
308 p_ll2_conn = qed_ll2_handle_sanity_inactive(p_hwfn, connection_handle); in qed_ll2_txq_flush()
309 if (!p_ll2_conn) in qed_ll2_txq_flush()
312 p_tx = &p_ll2_conn->tx_queue; in qed_ll2_txq_flush()
325 if (p_ll2_conn->input.conn_type == QED_LL2_TYPE_OOO) { in qed_ll2_txq_flush()
337 p_ll2_conn->cbs.tx_release_cb(p_ll2_conn->cbs.cookie, in qed_ll2_txq_flush()
338 p_ll2_conn->my_id, in qed_ll2_txq_flush()
351 struct qed_ll2_info *p_ll2_conn = p_cookie; in qed_ll2_txq_completion() local
352 struct qed_ll2_tx_queue *p_tx = &p_ll2_conn->tx_queue; in qed_ll2_txq_completion()
359 if (!p_ll2_conn) in qed_ll2_txq_completion()
401 p_ll2_conn->cbs.tx_comp_cb(p_ll2_conn->cbs.cookie, in qed_ll2_txq_completion()
402 p_ll2_conn->my_id, in qed_ll2_txq_completion()
448 struct qed_ll2_info *p_ll2_conn, in qed_ll2_handle_slowpath() argument
452 struct qed_ll2_rx_queue *p_rx = &p_ll2_conn->rx_queue; in qed_ll2_handle_slowpath()
463 if (!p_ll2_conn->cbs.slowpath_cb) { in qed_ll2_handle_slowpath()
471 p_ll2_conn->cbs.slowpath_cb(p_ll2_conn->cbs.cookie, in qed_ll2_handle_slowpath()
472 p_ll2_conn->my_id, in qed_ll2_handle_slowpath()
483 struct qed_ll2_info *p_ll2_conn, in qed_ll2_rxq_handle_completion() argument
487 struct qed_ll2_rx_queue *p_rx = &p_ll2_conn->rx_queue; in qed_ll2_rxq_handle_completion()
497 p_ll2_conn->input.conn_type); in qed_ll2_rxq_handle_completion()
513 data.connection_handle = p_ll2_conn->my_id; in qed_ll2_rxq_handle_completion()
519 p_ll2_conn->cbs.rx_comp_cb(p_ll2_conn->cbs.cookie, &data); in qed_ll2_rxq_handle_completion()
528 struct qed_ll2_info *p_ll2_conn = (struct qed_ll2_info *)cookie; in qed_ll2_rxq_completion() local
529 struct qed_ll2_rx_queue *p_rx = &p_ll2_conn->rx_queue; in qed_ll2_rxq_completion()
535 if (!p_ll2_conn) in qed_ll2_rxq_completion()
540 if (!QED_LL2_RX_REGISTERED(p_ll2_conn)) { in qed_ll2_rxq_completion()
563 rc = qed_ll2_handle_slowpath(p_hwfn, p_ll2_conn, in qed_ll2_rxq_completion()
568 rc = qed_ll2_rxq_handle_completion(p_hwfn, p_ll2_conn, in qed_ll2_rxq_completion()
583 struct qed_ll2_info *p_ll2_conn = NULL; in qed_ll2_rxq_flush() local
588 p_ll2_conn = qed_ll2_handle_sanity_inactive(p_hwfn, connection_handle); in qed_ll2_rxq_flush()
589 if (!p_ll2_conn) in qed_ll2_rxq_flush()
592 p_rx = &p_ll2_conn->rx_queue; in qed_ll2_rxq_flush()
603 if (p_ll2_conn->input.conn_type == QED_LL2_TYPE_OOO) { in qed_ll2_rxq_flush()
615 p_ll2_conn->cbs.rx_release_cb(p_ll2_conn->cbs.cookie, in qed_ll2_rxq_flush()
616 p_ll2_conn->my_id, in qed_ll2_rxq_flush()
647 struct qed_ll2_info *p_ll2_conn) in qed_ll2_lb_rxq_handler() argument
649 struct qed_ll2_rx_queue *p_rx = &p_ll2_conn->rx_queue; in qed_ll2_lb_rxq_handler()
785 struct qed_ll2_info *p_ll2_conn) in qed_ooo_submit_tx_buffers() argument
810 switch (p_ll2_conn->tx_dest) { in qed_ooo_submit_tx_buffers()
826 rc = qed_ll2_prepare_tx_packet(p_hwfn, p_ll2_conn->my_id, in qed_ooo_submit_tx_buffers()
838 struct qed_ll2_info *p_ll2_conn) in qed_ooo_submit_rx_buffers() argument
846 p_ll2_conn->my_id, in qed_ooo_submit_rx_buffers()
859 struct qed_ll2_info *p_ll2_conn = (struct qed_ll2_info *)p_cookie; in qed_ll2_lb_rxq_completion() local
862 if (!p_ll2_conn) in qed_ll2_lb_rxq_completion()
865 if (!QED_LL2_RX_REGISTERED(p_ll2_conn)) in qed_ll2_lb_rxq_completion()
868 rc = qed_ll2_lb_rxq_handler(p_hwfn, p_ll2_conn); in qed_ll2_lb_rxq_completion()
872 qed_ooo_submit_rx_buffers(p_hwfn, p_ll2_conn); in qed_ll2_lb_rxq_completion()
873 qed_ooo_submit_tx_buffers(p_hwfn, p_ll2_conn); in qed_ll2_lb_rxq_completion()
880 struct qed_ll2_info *p_ll2_conn = (struct qed_ll2_info *)p_cookie; in qed_ll2_lb_txq_completion() local
881 struct qed_ll2_tx_queue *p_tx = &p_ll2_conn->tx_queue; in qed_ll2_lb_txq_completion()
888 if (unlikely(!p_ll2_conn)) in qed_ll2_lb_txq_completion()
891 if (unlikely(!QED_LL2_TX_REGISTERED(p_ll2_conn))) in qed_ll2_lb_txq_completion()
931 rc = qed_ll2_post_rx_buffer(p_hwfn, p_ll2_conn->my_id, in qed_ll2_lb_txq_completion()
941 qed_ooo_submit_tx_buffers(p_hwfn, p_ll2_conn); in qed_ll2_lb_txq_completion()
959 struct qed_ll2_info *p_ll2_conn, in qed_sp_ll2_rx_queue_start() argument
962 enum qed_ll2_conn_type conn_type = p_ll2_conn->input.conn_type; in qed_sp_ll2_rx_queue_start()
963 struct qed_ll2_rx_queue *p_rx = &p_ll2_conn->rx_queue; in qed_sp_ll2_rx_queue_start()
972 init_data.cid = p_ll2_conn->cid; in qed_sp_ll2_rx_queue_start()
988 p_ramrod->mtu = cpu_to_le16(p_ll2_conn->input.mtu); in qed_sp_ll2_rx_queue_start()
995 p_ramrod->drop_ttl0_flg = p_ll2_conn->input.rx_drop_ttl0_flg; in qed_sp_ll2_rx_queue_start()
997 p_ll2_conn->input.rx_vlan_removal_en; in qed_sp_ll2_rx_queue_start()
1000 p_ll2_conn->input.conn_type == QED_LL2_TYPE_FCOE) in qed_sp_ll2_rx_queue_start()
1002 p_ramrod->queue_id = p_ll2_conn->queue_id; in qed_sp_ll2_rx_queue_start()
1003 p_ramrod->main_func_queue = p_ll2_conn->main_func_queue ? 1 : 0; in qed_sp_ll2_rx_queue_start()
1017 p_ramrod->gsi_offload_flag = p_ll2_conn->input.gsi_enable; in qed_sp_ll2_rx_queue_start()
1024 struct qed_ll2_info *p_ll2_conn) in qed_sp_ll2_tx_queue_start() argument
1026 enum qed_ll2_conn_type conn_type = p_ll2_conn->input.conn_type; in qed_sp_ll2_tx_queue_start()
1027 struct qed_ll2_tx_queue *p_tx = &p_ll2_conn->tx_queue; in qed_sp_ll2_tx_queue_start()
1034 if (!QED_LL2_TX_REGISTERED(p_ll2_conn)) in qed_sp_ll2_tx_queue_start()
1037 if (likely(p_ll2_conn->input.conn_type == QED_LL2_TYPE_OOO)) in qed_sp_ll2_tx_queue_start()
1038 p_ll2_conn->tx_stats_en = 0; in qed_sp_ll2_tx_queue_start()
1040 p_ll2_conn->tx_stats_en = 1; in qed_sp_ll2_tx_queue_start()
1044 init_data.cid = p_ll2_conn->cid; in qed_sp_ll2_tx_queue_start()
1058 p_ramrod->mtu = cpu_to_le16(p_ll2_conn->input.mtu); in qed_sp_ll2_tx_queue_start()
1059 p_ramrod->stats_en = p_ll2_conn->tx_stats_en; in qed_sp_ll2_tx_queue_start()
1060 p_ramrod->stats_id = p_ll2_conn->tx_stats_id; in qed_sp_ll2_tx_queue_start()
1067 switch (p_ll2_conn->input.tx_tc) { in qed_sp_ll2_tx_queue_start()
1106 p_ramrod->gsi_offload_flag = p_ll2_conn->input.gsi_enable; in qed_sp_ll2_tx_queue_start()
1119 struct qed_ll2_info *p_ll2_conn) in qed_sp_ll2_rx_queue_stop() argument
1128 init_data.cid = p_ll2_conn->cid; in qed_sp_ll2_rx_queue_stop()
1141 p_ramrod->queue_id = p_ll2_conn->queue_id; in qed_sp_ll2_rx_queue_stop()
1147 struct qed_ll2_info *p_ll2_conn) in qed_sp_ll2_tx_queue_stop() argument
1149 struct qed_ll2_tx_queue *p_tx = &p_ll2_conn->tx_queue; in qed_sp_ll2_tx_queue_stop()
1158 init_data.cid = p_ll2_conn->cid; in qed_sp_ll2_tx_queue_stop()
1491 struct qed_ll2_info *p_ll2_conn) in qed_ll2_establish_connection_rx() argument
1498 if (!QED_LL2_RX_REGISTERED(p_ll2_conn)) in qed_ll2_establish_connection_rx()
1501 DIRECT_REG_WR(p_ll2_conn->rx_queue.set_prod_addr, 0x0); in qed_ll2_establish_connection_rx()
1502 error_input = p_ll2_conn->input.ai_err_packet_too_big; in qed_ll2_establish_connection_rx()
1506 error_input = p_ll2_conn->input.ai_err_no_buf; in qed_ll2_establish_connection_rx()
1510 rc = qed_sp_ll2_rx_queue_start(p_hwfn, p_ll2_conn, action_on_error); in qed_ll2_establish_connection_rx()
1514 if (p_ll2_conn->rx_queue.ctx_based) { in qed_ll2_establish_connection_rx()
1516 p_ll2_conn->rx_queue.set_prod_addr, in qed_ll2_establish_connection_rx()
1517 &p_ll2_conn->rx_queue.db_data, in qed_ll2_establish_connection_rx()
1526 struct qed_ll2_info *p_ll2_conn) in qed_ll2_establish_connection_ooo() argument
1528 if (p_ll2_conn->input.conn_type != QED_LL2_TYPE_OOO) in qed_ll2_establish_connection_ooo()
1532 qed_ooo_submit_rx_buffers(p_hwfn, p_ll2_conn); in qed_ll2_establish_connection_ooo()
1565 struct qed_ll2_info *p_ll2_conn; in qed_ll2_establish_connection() local
1580 p_ll2_conn = qed_ll2_handle_sanity_lock(p_hwfn, connection_handle); in qed_ll2_establish_connection()
1581 if (!p_ll2_conn) { in qed_ll2_establish_connection()
1586 p_rx = &p_ll2_conn->rx_queue; in qed_ll2_establish_connection()
1587 p_tx = &p_ll2_conn->tx_queue; in qed_ll2_establish_connection()
1609 p_ll2_conn->input.tx_max_bds_per_packet); in qed_ll2_establish_connection()
1623 rc = qed_cxt_acquire_cid(p_hwfn, PROTOCOLID_CORE, &p_ll2_conn->cid); in qed_ll2_establish_connection()
1626 cxt_info.iid = p_ll2_conn->cid; in qed_ll2_establish_connection()
1630 p_ll2_conn->cid); in qed_ll2_establish_connection()
1639 p_ll2_conn->input.rx_conn_type); in qed_ll2_establish_connection()
1641 p_ll2_conn->input.rx_conn_type, in qed_ll2_establish_connection()
1643 p_ll2_conn->queue_id = qid; in qed_ll2_establish_connection()
1644 p_ll2_conn->tx_stats_id = stats_id; in qed_ll2_establish_connection()
1647 if (p_ll2_conn->tx_stats_id == QED_LL2_INVALID_STATS_ID) { in qed_ll2_establish_connection()
1648 p_ll2_conn->tx_stats_en = 0; in qed_ll2_establish_connection()
1659 p_ll2_conn->input.rx_conn_type, qid, stats_id); in qed_ll2_establish_connection()
1661 if (p_ll2_conn->input.rx_conn_type == QED_LL2_RX_TYPE_LEGACY) { in qed_ll2_establish_connection()
1675 p_rx->db_data.icid = cpu_to_le16((u16)p_ll2_conn->cid); in qed_ll2_establish_connection()
1683 qed_db_addr(p_ll2_conn->cid, in qed_ll2_establish_connection()
1692 rc = qed_ll2_establish_connection_rx(p_hwfn, p_ll2_conn); in qed_ll2_establish_connection()
1696 rc = qed_sp_ll2_tx_queue_start(p_hwfn, p_ll2_conn); in qed_ll2_establish_connection()
1704 qed_ll2_establish_connection_ooo(p_hwfn, p_ll2_conn); in qed_ll2_establish_connection()
1706 if (p_ll2_conn->input.conn_type == QED_LL2_TYPE_FCOE) { in qed_ll2_establish_connection()
1782 struct qed_ll2_info *p_ll2_conn; in qed_ll2_post_rx_buffer() local
1788 p_ll2_conn = qed_ll2_handle_sanity(p_hwfn, connection_handle); in qed_ll2_post_rx_buffer()
1789 if (!p_ll2_conn) in qed_ll2_post_rx_buffer()
1791 p_rx = &p_ll2_conn->rx_queue; in qed_ll2_post_rx_buffer()
1948 struct qed_ll2_info *p_ll2_conn) in qed_ll2_tx_packet_notify() argument
1950 bool b_notify = p_ll2_conn->tx_queue.cur_send_packet->notify_fw; in qed_ll2_tx_packet_notify()
1951 struct qed_ll2_tx_queue *p_tx = &p_ll2_conn->tx_queue; in qed_ll2_tx_packet_notify()
1956 if (p_ll2_conn->tx_queue.cur_send_frag_num != in qed_ll2_tx_packet_notify()
1957 p_ll2_conn->tx_queue.cur_send_packet->bd_used) in qed_ll2_tx_packet_notify()
1961 list_add_tail(&p_ll2_conn->tx_queue.cur_send_packet->list_entry, in qed_ll2_tx_packet_notify()
1962 &p_ll2_conn->tx_queue.sending_descq); in qed_ll2_tx_packet_notify()
1963 p_ll2_conn->tx_queue.cur_send_packet = NULL; in qed_ll2_tx_packet_notify()
1964 p_ll2_conn->tx_queue.cur_send_frag_num = 0; in qed_ll2_tx_packet_notify()
1970 bd_prod = qed_chain_get_prod_idx(&p_ll2_conn->tx_queue.txq_chain); in qed_ll2_tx_packet_notify()
1991 p_ll2_conn->queue_id, in qed_ll2_tx_packet_notify()
1992 p_ll2_conn->cid, in qed_ll2_tx_packet_notify()
1993 p_ll2_conn->input.conn_type, p_tx->db_msg.spq_prod); in qed_ll2_tx_packet_notify()
2003 struct qed_ll2_info *p_ll2_conn = NULL; in qed_ll2_prepare_tx_packet() local
2009 p_ll2_conn = qed_ll2_handle_sanity(p_hwfn, connection_handle); in qed_ll2_prepare_tx_packet()
2010 if (unlikely(!p_ll2_conn)) in qed_ll2_prepare_tx_packet()
2012 p_tx = &p_ll2_conn->tx_queue; in qed_ll2_prepare_tx_packet()
2015 if (unlikely(pkt->num_of_bds > p_ll2_conn->input.tx_max_bds_per_packet)) in qed_ll2_prepare_tx_packet()
2040 qed_ll2_prepare_tx_packet_set_bd(p_hwfn, p_ll2_conn, p_curp, pkt); in qed_ll2_prepare_tx_packet()
2042 qed_ll2_tx_packet_notify(p_hwfn, p_ll2_conn); in qed_ll2_prepare_tx_packet()
2055 struct qed_ll2_info *p_ll2_conn = NULL; in qed_ll2_set_fragment_of_tx_packet() local
2060 p_ll2_conn = qed_ll2_handle_sanity(p_hwfn, connection_handle); in qed_ll2_set_fragment_of_tx_packet()
2061 if (unlikely(!p_ll2_conn)) in qed_ll2_set_fragment_of_tx_packet()
2064 if (unlikely(!p_ll2_conn->tx_queue.cur_send_packet)) in qed_ll2_set_fragment_of_tx_packet()
2067 p_cur_send_packet = p_ll2_conn->tx_queue.cur_send_packet; in qed_ll2_set_fragment_of_tx_packet()
2068 cur_send_frag_num = p_ll2_conn->tx_queue.cur_send_frag_num; in qed_ll2_set_fragment_of_tx_packet()
2080 p_ll2_conn->tx_queue.cur_send_frag_num++; in qed_ll2_set_fragment_of_tx_packet()
2082 spin_lock_irqsave(&p_ll2_conn->tx_queue.lock, flags); in qed_ll2_set_fragment_of_tx_packet()
2083 qed_ll2_tx_packet_notify(p_hwfn, p_ll2_conn); in qed_ll2_set_fragment_of_tx_packet()
2084 spin_unlock_irqrestore(&p_ll2_conn->tx_queue.lock, flags); in qed_ll2_set_fragment_of_tx_packet()
2092 struct qed_ll2_info *p_ll2_conn = NULL; in qed_ll2_terminate_connection() local
2100 p_ll2_conn = qed_ll2_handle_sanity_lock(p_hwfn, connection_handle); in qed_ll2_terminate_connection()
2101 if (!p_ll2_conn) { in qed_ll2_terminate_connection()
2107 if (QED_LL2_TX_REGISTERED(p_ll2_conn)) { in qed_ll2_terminate_connection()
2108 p_ll2_conn->tx_queue.b_cb_registered = false; in qed_ll2_terminate_connection()
2110 rc = qed_sp_ll2_tx_queue_stop(p_hwfn, p_ll2_conn); in qed_ll2_terminate_connection()
2115 qed_int_unregister_cb(p_hwfn, p_ll2_conn->tx_queue.tx_sb_index); in qed_ll2_terminate_connection()
2118 if (QED_LL2_RX_REGISTERED(p_ll2_conn)) { in qed_ll2_terminate_connection()
2119 p_ll2_conn->rx_queue.b_cb_registered = false; in qed_ll2_terminate_connection()
2122 if (p_ll2_conn->rx_queue.ctx_based) in qed_ll2_terminate_connection()
2124 p_ll2_conn->rx_queue.set_prod_addr, in qed_ll2_terminate_connection()
2125 &p_ll2_conn->rx_queue.db_data); in qed_ll2_terminate_connection()
2127 rc = qed_sp_ll2_rx_queue_stop(p_hwfn, p_ll2_conn); in qed_ll2_terminate_connection()
2132 qed_int_unregister_cb(p_hwfn, p_ll2_conn->rx_queue.rx_sb_index); in qed_ll2_terminate_connection()
2135 if (p_ll2_conn->input.conn_type == QED_LL2_TYPE_OOO) in qed_ll2_terminate_connection()
2138 if (p_ll2_conn->input.conn_type == QED_LL2_TYPE_FCOE) { in qed_ll2_terminate_connection()
2154 struct qed_ll2_info *p_ll2_conn) in qed_ll2_release_connection_ooo() argument
2158 if (p_ll2_conn->input.conn_type != QED_LL2_TYPE_OOO) in qed_ll2_release_connection_ooo()
2175 struct qed_ll2_info *p_ll2_conn = NULL; in qed_ll2_release_connection() local
2177 p_ll2_conn = qed_ll2_handle_sanity(p_hwfn, connection_handle); in qed_ll2_release_connection()
2178 if (!p_ll2_conn) in qed_ll2_release_connection()
2181 kfree(p_ll2_conn->tx_queue.descq_mem); in qed_ll2_release_connection()
2182 qed_chain_free(p_hwfn->cdev, &p_ll2_conn->tx_queue.txq_chain); in qed_ll2_release_connection()
2184 kfree(p_ll2_conn->rx_queue.descq_array); in qed_ll2_release_connection()
2185 qed_chain_free(p_hwfn->cdev, &p_ll2_conn->rx_queue.rxq_chain); in qed_ll2_release_connection()
2186 qed_chain_free(p_hwfn->cdev, &p_ll2_conn->rx_queue.rcq_chain); in qed_ll2_release_connection()
2188 qed_cxt_release_cid(p_hwfn, p_ll2_conn->cid); in qed_ll2_release_connection()
2190 qed_ll2_release_connection_ooo(p_hwfn, p_ll2_conn); in qed_ll2_release_connection()
2192 mutex_lock(&p_ll2_conn->mutex); in qed_ll2_release_connection()
2193 p_ll2_conn->b_active = false; in qed_ll2_release_connection()
2194 mutex_unlock(&p_ll2_conn->mutex); in qed_ll2_release_connection()
2257 struct qed_ll2_info *p_ll2_conn, in _qed_ll2_get_tstats() argument
2261 u8 qid = p_ll2_conn->queue_id; in _qed_ll2_get_tstats()
2276 struct qed_ll2_info *p_ll2_conn, in _qed_ll2_get_ustats() argument
2280 u8 qid = p_ll2_conn->queue_id; in _qed_ll2_get_ustats()
2298 struct qed_ll2_info *p_ll2_conn, in _qed_ll2_get_pstats() argument
2302 u8 stats_id = p_ll2_conn->tx_stats_id; in _qed_ll2_get_pstats()
2322 struct qed_ll2_info *p_ll2_conn = NULL; in __qed_ll2_get_stats() local
2329 p_ll2_conn = &p_hwfn->p_ll2_info[connection_handle]; in __qed_ll2_get_stats()
2337 if (p_ll2_conn->input.gsi_enable) in __qed_ll2_get_stats()
2340 _qed_ll2_get_tstats(p_hwfn, p_ptt, p_ll2_conn, p_stats); in __qed_ll2_get_stats()
2342 _qed_ll2_get_ustats(p_hwfn, p_ptt, p_ll2_conn, p_stats); in __qed_ll2_get_stats()
2344 if (p_ll2_conn->tx_stats_en) in __qed_ll2_get_stats()
2345 _qed_ll2_get_pstats(p_hwfn, p_ptt, p_ll2_conn, p_stats); in __qed_ll2_get_stats()