Lines Matching refs:vsi

51 irdma_alloc_node(struct irdma_sc_vsi *vsi,  in irdma_alloc_node()  argument
66 node_index = irdma_alloc_ws_node_id(vsi->dev); in irdma_alloc_node()
75 node->vsi_index = vsi->vsi_idx; in irdma_alloc_node()
79 node->traffic_class = vsi->qos[user_pri].traffic_class; in irdma_alloc_node()
81 node->rel_bw = vsi->qos[user_pri].rel_bw; in irdma_alloc_node()
103 irdma_free_node(struct irdma_sc_vsi *vsi, in irdma_free_node() argument
109 irdma_free_ws_node_id(vsi->dev, node->index); in irdma_free_node()
123 irdma_ws_cqp_cmd(struct irdma_sc_vsi *vsi, in irdma_ws_cqp_cmd() argument
129 node_info.vsi = node->vsi_index; in irdma_ws_cqp_cmd()
140 if (irdma_cqp_ws_node_cmd(vsi->dev, cmd, &node_info)) { in irdma_ws_cqp_cmd()
141 irdma_debug(vsi->dev, IRDMA_DEBUG_WS, "CQP WS CMD failed\n"); in irdma_ws_cqp_cmd()
147 vsi->qos[node->user_pri].qs_handle = node_info.qs_handle; in irdma_ws_cqp_cmd()
192 irdma_ws_in_use(struct irdma_sc_vsi *vsi, u8 user_pri) in irdma_ws_in_use() argument
196 mutex_lock(&vsi->qos[user_pri].qos_mutex); in irdma_ws_in_use()
197 if (!list_empty(&vsi->qos[user_pri].qplist)) { in irdma_ws_in_use()
198 mutex_unlock(&vsi->qos[user_pri].qos_mutex); in irdma_ws_in_use()
207 if (vsi->qos[i].qs_handle == vsi->qos[user_pri].qs_handle && in irdma_ws_in_use()
208 !list_empty(&vsi->qos[i].qplist)) { in irdma_ws_in_use()
209 mutex_unlock(&vsi->qos[user_pri].qos_mutex); in irdma_ws_in_use()
213 mutex_unlock(&vsi->qos[user_pri].qos_mutex); in irdma_ws_in_use()
224 irdma_remove_leaf(struct irdma_sc_vsi *vsi, u8 user_pri) in irdma_remove_leaf() argument
230 qs_handle = vsi->qos[user_pri].qs_handle; in irdma_remove_leaf()
232 if (vsi->qos[i].qs_handle == qs_handle) in irdma_remove_leaf()
233 vsi->qos[i].valid = false; in irdma_remove_leaf()
235 ws_tree_root = vsi->dev->ws_tree_root; in irdma_remove_leaf()
239 vsi_node = ws_find_node(ws_tree_root, vsi->vsi_idx, in irdma_remove_leaf()
245 vsi->qos[user_pri].traffic_class, in irdma_remove_leaf()
250 irdma_ws_cqp_cmd(vsi, tc_node, IRDMA_OP_WS_DELETE_NODE); in irdma_remove_leaf()
251 vsi->unregister_qset(vsi, tc_node); in irdma_remove_leaf()
253 irdma_free_node(vsi, tc_node); in irdma_remove_leaf()
256 irdma_ws_cqp_cmd(vsi, vsi_node, IRDMA_OP_WS_DELETE_NODE); in irdma_remove_leaf()
258 irdma_free_node(vsi, vsi_node); in irdma_remove_leaf()
261 irdma_ws_cqp_cmd(vsi, ws_tree_root, in irdma_remove_leaf()
263 irdma_free_node(vsi, ws_tree_root); in irdma_remove_leaf()
264 vsi->dev->ws_tree_root = NULL; in irdma_remove_leaf()
275 irdma_ws_add(struct irdma_sc_vsi *vsi, u8 user_pri) in irdma_ws_add() argument
284 mutex_lock(&vsi->dev->ws_mutex); in irdma_ws_add()
285 if (vsi->tc_change_pending) { in irdma_ws_add()
290 if (vsi->qos[user_pri].valid) in irdma_ws_add()
293 ws_tree_root = vsi->dev->ws_tree_root; in irdma_ws_add()
295 ws_tree_root = irdma_alloc_node(vsi, user_pri, in irdma_ws_add()
301 irdma_debug(vsi->dev, IRDMA_DEBUG_WS, "Creating root node = %d\n", ws_tree_root->index); in irdma_ws_add()
303 ret = irdma_ws_cqp_cmd(vsi, ws_tree_root, IRDMA_OP_WS_ADD_NODE); in irdma_ws_add()
305 irdma_free_node(vsi, ws_tree_root); in irdma_ws_add()
309 vsi->dev->ws_tree_root = ws_tree_root; in irdma_ws_add()
313 vsi_node = ws_find_node(ws_tree_root, vsi->vsi_idx, in irdma_ws_add()
318 irdma_debug(vsi->dev, IRDMA_DEBUG_WS, in irdma_ws_add()
319 "Node not found matching VSI %d\n", vsi->vsi_idx); in irdma_ws_add()
320 vsi_node = irdma_alloc_node(vsi, user_pri, WS_NODE_TYPE_PARENT, in irdma_ws_add()
327 ret = irdma_ws_cqp_cmd(vsi, vsi_node, IRDMA_OP_WS_ADD_NODE); in irdma_ws_add()
329 irdma_free_node(vsi, vsi_node); in irdma_ws_add()
336 irdma_debug(vsi->dev, IRDMA_DEBUG_WS, in irdma_ws_add()
338 vsi->vsi_idx); in irdma_ws_add()
339 traffic_class = vsi->qos[user_pri].traffic_class; in irdma_ws_add()
344 irdma_debug(vsi->dev, IRDMA_DEBUG_WS, in irdma_ws_add()
346 vsi->vsi_idx, traffic_class); in irdma_ws_add()
347 tc_node = irdma_alloc_node(vsi, user_pri, WS_NODE_TYPE_LEAF, in irdma_ws_add()
354 ret = irdma_ws_cqp_cmd(vsi, tc_node, IRDMA_OP_WS_ADD_NODE); in irdma_ws_add()
356 irdma_free_node(vsi, tc_node); in irdma_ws_add()
364 ret = vsi->register_qset(vsi, tc_node); in irdma_ws_add()
369 ret = irdma_ws_cqp_cmd(vsi, tc_node, IRDMA_OP_WS_MODIFY_NODE); in irdma_ws_add()
371 vsi->unregister_qset(vsi, tc_node); in irdma_ws_add()
375 irdma_debug(vsi->dev, IRDMA_DEBUG_WS, in irdma_ws_add()
377 tc_node->index, vsi->vsi_idx, traffic_class); in irdma_ws_add()
382 if (vsi->qos[i].traffic_class == traffic_class) { in irdma_ws_add()
383 vsi->qos[i].qs_handle = tc_node->qs_handle; in irdma_ws_add()
384 vsi->qos[i].l2_sched_node_id = tc_node->l2_sched_node_id; in irdma_ws_add()
385 vsi->qos[i].valid = true; in irdma_ws_add()
391 irdma_ws_cqp_cmd(vsi, tc_node, IRDMA_OP_WS_DELETE_NODE); in irdma_ws_add()
393 irdma_free_node(vsi, tc_node); in irdma_ws_add()
396 if (irdma_ws_cqp_cmd(vsi, vsi_node, IRDMA_OP_WS_DELETE_NODE)) in irdma_ws_add()
399 irdma_free_node(vsi, vsi_node); in irdma_ws_add()
405 irdma_ws_cqp_cmd(vsi, ws_tree_root, IRDMA_OP_WS_DELETE_NODE); in irdma_ws_add()
406 vsi->dev->ws_tree_root = NULL; in irdma_ws_add()
407 irdma_free_node(vsi, ws_tree_root); in irdma_ws_add()
411 mutex_unlock(&vsi->dev->ws_mutex); in irdma_ws_add()
421 irdma_ws_remove(struct irdma_sc_vsi *vsi, u8 user_pri) in irdma_ws_remove() argument
423 mutex_lock(&vsi->dev->ws_mutex); in irdma_ws_remove()
424 if (irdma_ws_in_use(vsi, user_pri)) in irdma_ws_remove()
426 irdma_remove_leaf(vsi, user_pri); in irdma_ws_remove()
428 mutex_unlock(&vsi->dev->ws_mutex); in irdma_ws_remove()
436 irdma_ws_reset(struct irdma_sc_vsi *vsi) in irdma_ws_reset() argument
440 mutex_lock(&vsi->dev->ws_mutex); in irdma_ws_reset()
442 irdma_remove_leaf(vsi, i); in irdma_ws_reset()
443 mutex_unlock(&vsi->dev->ws_mutex); in irdma_ws_reset()