* idpf_ctlq_init - main initialization routine for all control queues * @hw: pointer to hardware struct * @num_q: number of queues to initialize * @q_info: array of structs containing info for each queue to be initialized * * This initializes any number and any type of control queues. This is an all * or nothing routine; if one fails, all previously allocated queues will be * destroyed. Thi
| 233 | * APIs. |
| 234 | */ |
| 235 | int idpf_ctlq_init(struct idpf_hw *hw, u8 num_q, |
| 236 | struct idpf_ctlq_create_info *q_info) |
| 237 | { |
| 238 | struct idpf_ctlq_info *cq = NULL, *tmp = NULL; |
| 239 | int ret_code = 0; |
| 240 | int i = 0; |
| 241 | |
| 242 | LIST_INIT(&hw->cq_list_head); |
| 243 | |
| 244 | for (i = 0; i < num_q; i++) { |
| 245 | struct idpf_ctlq_create_info *qinfo = q_info + i; |
| 246 | |
| 247 | ret_code = idpf_ctlq_add(hw, qinfo, &cq); |
| 248 | if (ret_code) |
| 249 | goto init_destroy_qs; |
| 250 | } |
| 251 | |
| 252 | return ret_code; |
| 253 | |
| 254 | init_destroy_qs: |
| 255 | LIST_FOR_EACH_ENTRY_SAFE(cq, tmp, &hw->cq_list_head, |
| 256 | idpf_ctlq_info, cq_list) |
| 257 | idpf_ctlq_remove(hw, cq); |
| 258 | |
| 259 | return ret_code; |
| 260 | } |
| 261 | |
| 262 | /** |
| 263 | * idpf_ctlq_deinit - destroy all control queues |
no test coverage detected