Lines Matching refs:p_l2_info

54 	struct qed_l2_info *p_l2_info;  in qed_l2_alloc()  local
61 p_l2_info = kzalloc(sizeof(*p_l2_info), GFP_KERNEL); in qed_l2_alloc()
62 if (!p_l2_info) in qed_l2_alloc()
64 p_hwfn->p_l2_info = p_l2_info; in qed_l2_alloc()
67 p_l2_info->queues = RESC_NUM(p_hwfn, QED_L2_QUEUE); in qed_l2_alloc()
74 p_l2_info->queues = max_t(u8, rx, tx); in qed_l2_alloc()
77 pp_qids = kcalloc(p_l2_info->queues, sizeof(unsigned long *), in qed_l2_alloc()
81 p_l2_info->pp_qid_usage = pp_qids; in qed_l2_alloc()
83 for (i = 0; i < p_l2_info->queues; i++) { in qed_l2_alloc()
97 mutex_init(&p_hwfn->p_l2_info->lock); in qed_l2_setup()
107 if (!p_hwfn->p_l2_info) in qed_l2_free()
110 if (!p_hwfn->p_l2_info->pp_qid_usage) in qed_l2_free()
114 for (i = 0; i < p_hwfn->p_l2_info->queues; i++) { in qed_l2_free()
115 if (!p_hwfn->p_l2_info->pp_qid_usage[i]) in qed_l2_free()
117 kfree(p_hwfn->p_l2_info->pp_qid_usage[i]); in qed_l2_free()
120 kfree(p_hwfn->p_l2_info->pp_qid_usage); in qed_l2_free()
123 kfree(p_hwfn->p_l2_info); in qed_l2_free()
124 p_hwfn->p_l2_info = NULL; in qed_l2_free()
130 struct qed_l2_info *p_l2_info = p_hwfn->p_l2_info; in qed_eth_queue_qid_usage_add() local
135 mutex_lock(&p_l2_info->lock); in qed_eth_queue_qid_usage_add()
137 if (queue_id >= p_l2_info->queues) { in qed_eth_queue_qid_usage_add()
140 queue_id, p_l2_info->queues); in qed_eth_queue_qid_usage_add()
145 first = (u8)find_first_zero_bit(p_l2_info->pp_qid_usage[queue_id], in qed_eth_queue_qid_usage_add()
152 __set_bit(first, p_l2_info->pp_qid_usage[queue_id]); in qed_eth_queue_qid_usage_add()
156 mutex_unlock(&p_l2_info->lock); in qed_eth_queue_qid_usage_add()
163 mutex_lock(&p_hwfn->p_l2_info->lock); in qed_eth_queue_qid_usage_del()
166 p_hwfn->p_l2_info->pp_qid_usage[p_cid->rel.queue_id]); in qed_eth_queue_qid_usage_del()
168 mutex_unlock(&p_hwfn->p_l2_info->lock); in qed_eth_queue_qid_usage_del()