Lines Matching +full:bypass +full:- +full:slot +full:- +full:no
1 /*-
2 * Copyright 2016-2023 Microchip Technology, Inc. and/or its subsidiaries.
16 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
55 if(elem_alloted - 1) in pqisrc_embedded_sgl_count()
56 embedded_sgl_count += ((elem_alloted - 1) * MAX_EMBEDDED_SG_IN_IU); in pqisrc_embedded_sgl_count()
74 contiguous_free_elem = (elem_in_q - pi); in pqisrc_contiguous_free_elem()
76 contiguous_free_elem -= 1; in pqisrc_contiguous_free_elem()
78 contiguous_free_elem = (ci - pi - 1); in pqisrc_contiguous_free_elem()
98 if ((devp->raid_level == SA_RAID_5 || devp->raid_level == SA_RAID_6) in pqisrc_num_elem_needed()
107 if(SG_Count > softs->max_sg_per_spanning_cmd || in pqisrc_num_elem_needed()
113 num_sg = SG_Count - sg_in_first_iu; in pqisrc_num_elem_needed()
138 iu_hdr->iu_type)) { in pqisrc_build_sgl()
141 sgt->addr= OS_GET_IO_SG_ADDR(rcb,i); in pqisrc_build_sgl()
142 sgt->len= OS_GET_IO_SG_LEN(rcb,i); in pqisrc_build_sgl()
143 sgt->flags= 0; in pqisrc_build_sgl()
146 sg_array[num_sg - 1].flags = SG_FLAG_LAST; in pqisrc_build_sgl()
151 sg_chain = rcb->sg_chain_virt; in pqisrc_build_sgl()
152 sgt->addr = rcb->sg_chain_dma; in pqisrc_build_sgl()
153 sgt->len = num_sg * sizeof(sgt_t); in pqisrc_build_sgl()
154 sgt->flags = SG_FLAG_CHAIN; in pqisrc_build_sgl()
158 sgt->addr = OS_GET_IO_SG_ADDR(rcb,i); in pqisrc_build_sgl()
159 sgt->len = OS_GET_IO_SG_LEN(rcb,i); in pqisrc_build_sgl()
160 sgt->flags = 0; in pqisrc_build_sgl()
163 sg_chain[num_sg - 1].flags = SG_FLAG_LAST; in pqisrc_build_sgl()
169 iu_hdr->iu_length = num_sg * sizeof(sgt_t); in pqisrc_build_sgl()
179 DBG_IO("%30s: 0x%x\n", "raid_req->header.iu_type",
180 raid_req->header.iu_type);
181 DBG_IO("%30s: 0x%d\n", "raid_req->response_queue_id",
182 raid_req->response_queue_id);
183 DBG_IO("%30s: 0x%x\n", "raid_req->request_id",
184 raid_req->request_id);
185 DBG_IO("%30s: 0x%x\n", "raid_req->buffer_length",
186 raid_req->buffer_length);
187 DBG_IO("%30s: 0x%x\n", "raid_req->task_attribute",
188 raid_req->task_attribute);
189 DBG_IO("%30s: 0x%llx\n", "raid_req->lun_number",
190 *((long long unsigned int*)raid_req->lun_number));
191 DBG_IO("%30s: 0x%x\n", "raid_req->error_index",
192 raid_req->error_index);
193 DBG_IO("%30s: 0x%p\n", "raid_req->sg_descriptors[0].addr",
194 (void *)raid_req->sg_descriptors[0].addr);
195 DBG_IO("%30s: 0x%x\n", "raid_req->sg_descriptors[0].len",
196 raid_req->sg_descriptors[0].len);
197 DBG_IO("%30s: 0x%x\n", "raid_req->sg_descriptors[0].flags",
198 raid_req->sg_descriptors[0].flags);
209 raid_req->header.iu_type = PQI_IU_TYPE_RAID_PATH_IO_REQUEST; in pqisrc_build_raid_io()
210 raid_req->header.comp_feature = 0; in pqisrc_build_raid_io()
211 raid_req->response_queue_id = OS_GET_IO_RESP_QID(softs, rcb); in pqisrc_build_raid_io()
212 raid_req->work_area[0] = 0; in pqisrc_build_raid_io()
213 raid_req->work_area[1] = 0; in pqisrc_build_raid_io()
214 raid_req->request_id = rcb->tag; in pqisrc_build_raid_io()
215 raid_req->nexus_id = 0; in pqisrc_build_raid_io()
216 raid_req->buffer_length = GET_SCSI_BUFFLEN(rcb); in pqisrc_build_raid_io()
217 memcpy(raid_req->lun_number, rcb->dvp->scsi3addr, in pqisrc_build_raid_io()
218 sizeof(raid_req->lun_number)); in pqisrc_build_raid_io()
219 raid_req->protocol_spec = 0; in pqisrc_build_raid_io()
220 raid_req->data_direction = rcb->data_dir; in pqisrc_build_raid_io()
221 raid_req->reserved1 = 0; in pqisrc_build_raid_io()
222 raid_req->fence = 0; in pqisrc_build_raid_io()
223 raid_req->error_index = raid_req->request_id; in pqisrc_build_raid_io()
224 raid_req->reserved2 = 0; in pqisrc_build_raid_io()
225 raid_req->task_attribute = OS_GET_TASK_ATTR(rcb); in pqisrc_build_raid_io()
226 raid_req->command_priority = 0; in pqisrc_build_raid_io()
227 raid_req->reserved3 = 0; in pqisrc_build_raid_io()
228 raid_req->reserved4 = 0; in pqisrc_build_raid_io()
229 raid_req->reserved5 = 0; in pqisrc_build_raid_io()
230 raid_req->ml_device_lun_number = (uint8_t)rcb->cm_ccb->ccb_h.target_lun; in pqisrc_build_raid_io()
234 memcpy(raid_req->cmd.cdb, rcb->cdbp, rcb->cmdlen); in pqisrc_build_raid_io()
237 for(i = 0; i < rcb->cmdlen ; i++) in pqisrc_build_raid_io()
238 DBG_IO(" 0x%x \n ",raid_req->cdb[i]); in pqisrc_build_raid_io()
241 switch (rcb->cmdlen) { in pqisrc_build_raid_io()
246 raid_req->additional_cdb_bytes_usage = in pqisrc_build_raid_io()
250 raid_req->additional_cdb_bytes_usage = in pqisrc_build_raid_io()
254 raid_req->additional_cdb_bytes_usage = in pqisrc_build_raid_io()
258 raid_req->additional_cdb_bytes_usage = in pqisrc_build_raid_io()
263 raid_req->additional_cdb_bytes_usage = in pqisrc_build_raid_io()
269 raid_req->partial = pqisrc_build_sgl(&raid_req->sg_descriptors[0], rcb, in pqisrc_build_raid_io()
270 &raid_req->header, num_elem_alloted); in pqisrc_build_raid_io()
272 raid_req->header.iu_length += in pqisrc_build_raid_io()
273 offsetof(pqisrc_raid_req_t, sg_descriptors) - sizeof(iu_header_t); in pqisrc_build_raid_io()
278 rcb->success_cmp_callback = pqisrc_process_io_response_success; in pqisrc_build_raid_io()
279 rcb->error_cmp_callback = pqisrc_process_raid_response_error; in pqisrc_build_raid_io()
280 rcb->resp_qid = raid_req->response_queue_id; in pqisrc_build_raid_io()
293 DBG_IO("%30s: 0x%x\n", "aio_req->header.iu_type",
294 aio_req->header.iu_type);
295 DBG_IO("%30s: 0x%x\n", "aio_req->resp_qid",
296 aio_req->response_queue_id);
297 DBG_IO("%30s: 0x%x\n", "aio_req->req_id",
298 aio_req->req_id);
299 DBG_IO("%30s: 0x%x\n", "aio_req->nexus",
300 aio_req->nexus);
301 DBG_IO("%30s: 0x%x\n", "aio_req->buf_len",
302 aio_req->buf_len);
303 DBG_IO("%30s: 0x%x\n", "aio_req->cmd_flags.data_dir",
304 aio_req->cmd_flags.data_dir);
305 DBG_IO("%30s: 0x%x\n", "aio_req->attr_prio.task_attr",
306 aio_req->attr_prio.task_attr);
307 DBG_IO("%30s: 0x%x\n", "aio_req->err_idx",
308 aio_req->err_idx);
309 DBG_IO("%30s: 0x%x\n", "aio_req->num_sg",
310 aio_req->num_sg);
311 DBG_IO("%30s: 0x%p\n", "aio_req->sg_desc[0].addr",
312 (void *)aio_req->sg_desc[0].addr);
313 DBG_IO("%30s: 0x%x\n", "aio_req->sg_desc[0].len",
314 aio_req->sg_desc[0].len);
315 DBG_IO("%30s: 0x%x\n", "aio_req->sg_desc[0].flags",
316 aio_req->sg_desc[0].flags);
340 aio_req->header.iu_type = PQI_IU_TYPE_AIO_PATH_IO_REQUEST; in pqisrc_build_aio_common()
341 aio_req->header.comp_feature = 0; in pqisrc_build_aio_common()
342 aio_req->response_queue_id = OS_GET_IO_RESP_QID(softs, rcb); in pqisrc_build_aio_common()
343 aio_req->work_area[0] = 0; in pqisrc_build_aio_common()
344 aio_req->work_area[1] = 0; in pqisrc_build_aio_common()
345 aio_req->req_id = rcb->tag; in pqisrc_build_aio_common()
346 aio_req->res1[0] = 0; in pqisrc_build_aio_common()
347 aio_req->res1[1] = 0; in pqisrc_build_aio_common()
348 aio_req->nexus = rcb->ioaccel_handle; in pqisrc_build_aio_common()
349 aio_req->buf_len = GET_SCSI_BUFFLEN(rcb); in pqisrc_build_aio_common()
350 aio_req->cmd_flags.data_dir = rcb->data_dir; in pqisrc_build_aio_common()
351 aio_req->cmd_flags.mem_type = 0; in pqisrc_build_aio_common()
352 aio_req->cmd_flags.fence = 0; in pqisrc_build_aio_common()
353 aio_req->cmd_flags.res2 = 0; in pqisrc_build_aio_common()
354 aio_req->attr_prio.task_attr = OS_GET_TASK_ATTR(rcb); in pqisrc_build_aio_common()
355 aio_req->attr_prio.cmd_prio = 0; in pqisrc_build_aio_common()
356 aio_req->attr_prio.res3 = 0; in pqisrc_build_aio_common()
357 aio_req->err_idx = aio_req->req_id; in pqisrc_build_aio_common()
358 aio_req->cdb_len = rcb->cmdlen; in pqisrc_build_aio_common()
360 if (rcb->cmdlen > sizeof(aio_req->cdb)) in pqisrc_build_aio_common()
361 rcb->cmdlen = sizeof(aio_req->cdb); in pqisrc_build_aio_common()
362 memcpy(aio_req->cdb, rcb->cdbp, rcb->cmdlen); in pqisrc_build_aio_common()
363 memset(aio_req->res4, 0, sizeof(aio_req->res4)); in pqisrc_build_aio_common()
365 uint64_t lun = rcb->cm_ccb->ccb_h.target_lun; in pqisrc_build_aio_common()
366 if (lun && (rcb->dvp->is_multi_lun)) { in pqisrc_build_aio_common()
367 int_to_scsilun(lun, aio_req->lun); in pqisrc_build_aio_common()
370 memset(aio_req->lun, 0, sizeof(aio_req->lun)); in pqisrc_build_aio_common()
374 if (rcb->encrypt_enable == true) { in pqisrc_build_aio_common()
375 aio_req->cmd_flags.encrypt_enable = true; in pqisrc_build_aio_common()
376 aio_req->encrypt_key_index = in pqisrc_build_aio_common()
377 LE_16(rcb->enc_info.data_enc_key_index); in pqisrc_build_aio_common()
378 aio_req->encrypt_twk_low = in pqisrc_build_aio_common()
379 LE_32(rcb->enc_info.encrypt_tweak_lower); in pqisrc_build_aio_common()
380 aio_req->encrypt_twk_high = in pqisrc_build_aio_common()
381 LE_32(rcb->enc_info.encrypt_tweak_upper); in pqisrc_build_aio_common()
383 aio_req->cmd_flags.encrypt_enable = 0; in pqisrc_build_aio_common()
384 aio_req->encrypt_key_index = 0; in pqisrc_build_aio_common()
385 aio_req->encrypt_twk_high = 0; in pqisrc_build_aio_common()
386 aio_req->encrypt_twk_low = 0; in pqisrc_build_aio_common()
389 aio_req->cmd_flags.partial = pqisrc_build_sgl(&aio_req->sg_desc[0], rcb, in pqisrc_build_aio_common()
390 &aio_req->header, num_elem_alloted); in pqisrc_build_aio_common()
392 aio_req->num_sg = aio_req->header.iu_length / sizeof(sgt_t); in pqisrc_build_aio_common()
394 /* DBG_INFO("aio_req->num_sg :%d\n", aio_req->num_sg); */ in pqisrc_build_aio_common()
396 aio_req->header.iu_length += offsetof(pqi_aio_req_t, sg_desc) - in pqisrc_build_aio_common()
399 rcb->success_cmp_callback = pqisrc_process_io_response_success; in pqisrc_build_aio_common()
400 rcb->error_cmp_callback = pqisrc_process_aio_response_error; in pqisrc_build_aio_common()
401 rcb->resp_qid = aio_req->response_queue_id; in pqisrc_build_aio_common()
411 DBG_INFO("AIO IU Content, tag# 0x%08x", rcb->tag); in pqisrc_show_aio_common()
412 DBG_INFO("%15s: 0x%x\n", "iu_type", aio_req->header.iu_type); in pqisrc_show_aio_common()
413 DBG_INFO("%15s: 0x%x\n", "comp_feat", aio_req->header.comp_feature); in pqisrc_show_aio_common()
414 DBG_INFO("%15s: 0x%x\n", "length", aio_req->header.iu_length); in pqisrc_show_aio_common()
415 DBG_INFO("%15s: 0x%x\n", "resp_qid", aio_req->response_queue_id); in pqisrc_show_aio_common()
416 DBG_INFO("%15s: 0x%x\n", "req_id", aio_req->req_id); in pqisrc_show_aio_common()
417 DBG_INFO("%15s: 0x%x\n", "nexus", aio_req->nexus); in pqisrc_show_aio_common()
418 DBG_INFO("%15s: 0x%x\n", "buf_len", aio_req->buf_len); in pqisrc_show_aio_common()
420 DBG_INFO("%15s: 0x%x\n", "data_dir", aio_req->cmd_flags.data_dir); in pqisrc_show_aio_common()
421 DBG_INFO("%15s: 0x%x\n", "partial", aio_req->cmd_flags.partial); in pqisrc_show_aio_common()
422 DBG_INFO("%15s: 0x%x\n", "mem_type", aio_req->cmd_flags.mem_type); in pqisrc_show_aio_common()
423 DBG_INFO("%15s: 0x%x\n", "fence", aio_req->cmd_flags.fence); in pqisrc_show_aio_common()
425 aio_req->cmd_flags.encrypt_enable); in pqisrc_show_aio_common()
427 DBG_INFO("%15s: 0x%x\n", "task_attr", aio_req->attr_prio.task_attr); in pqisrc_show_aio_common()
428 DBG_INFO("%15s: 0x%x\n", "cmd_prio", aio_req->attr_prio.cmd_prio); in pqisrc_show_aio_common()
429 DBG_INFO("%15s: 0x%x\n", "dek_index", aio_req->encrypt_key_index); in pqisrc_show_aio_common()
430 DBG_INFO("%15s: 0x%x\n", "tweak_lower", aio_req->encrypt_twk_low); in pqisrc_show_aio_common()
431 DBG_INFO("%15s: 0x%x\n", "tweak_upper", aio_req->encrypt_twk_high); in pqisrc_show_aio_common()
432 pqisrc_show_cdb(softs, "AIOC", rcb, aio_req->cdb); in pqisrc_show_aio_common()
433 DBG_INFO("%15s: 0x%x\n", "err_idx", aio_req->err_idx); in pqisrc_show_aio_common()
434 DBG_INFO("%15s: 0x%x\n", "num_sg", aio_req->num_sg); in pqisrc_show_aio_common()
435 DBG_INFO("%15s: 0x%x\n", "cdb_len", aio_req->cdb_len); in pqisrc_show_aio_common()
437 DBG_INFO("%15s: 0x%x\n", "lun", aio_req->lun); in pqisrc_show_aio_common()
439 (void *)aio_req->sg_desc[0].addr); in pqisrc_show_aio_common()
441 aio_req->sg_desc[0].len); in pqisrc_show_aio_common()
443 aio_req->sg_desc[0].flags); in pqisrc_show_aio_common()
448 /*Subroutine used to populate AIO RAID 1 write bypass IU. */
455 if (!rcb->dvp) { in pqisrc_build_aio_R1_write()
459 if (!rcb->dvp->raid_map) { in pqisrc_build_aio_R1_write()
464 aio_req->header.iu_type = PQI_IU_TYPE_RAID1_WRITE_BYPASS_REQUEST; in pqisrc_build_aio_R1_write()
465 aio_req->header.comp_feature = 0; in pqisrc_build_aio_R1_write()
466 aio_req->response_queue_id = OS_GET_IO_RESP_QID(softs, rcb); in pqisrc_build_aio_R1_write()
467 aio_req->work_area[0] = 0; in pqisrc_build_aio_R1_write()
468 aio_req->work_area[1] = 0; in pqisrc_build_aio_R1_write()
469 aio_req->req_id = rcb->tag; in pqisrc_build_aio_R1_write()
470 aio_req->volume_id = (LE_32(rcb->dvp->scsi3addr[0]) & 0x3FFF); in pqisrc_build_aio_R1_write()
471 aio_req->nexus_1 = rcb->it_nexus[0]; in pqisrc_build_aio_R1_write()
472 aio_req->nexus_2 = rcb->it_nexus[1]; in pqisrc_build_aio_R1_write()
473 aio_req->nexus_3 = rcb->it_nexus[2]; in pqisrc_build_aio_R1_write()
474 aio_req->buf_len = GET_SCSI_BUFFLEN(rcb); in pqisrc_build_aio_R1_write()
475 aio_req->cmd_flags.data_dir = rcb->data_dir; in pqisrc_build_aio_R1_write()
476 aio_req->cmd_flags.mem_type = 0; in pqisrc_build_aio_R1_write()
477 aio_req->cmd_flags.fence = 0; in pqisrc_build_aio_R1_write()
478 aio_req->cmd_flags.res2 = 0; in pqisrc_build_aio_R1_write()
479 aio_req->attr_prio.task_attr = OS_GET_TASK_ATTR(rcb); in pqisrc_build_aio_R1_write()
480 aio_req->attr_prio.cmd_prio = 0; in pqisrc_build_aio_R1_write()
481 aio_req->attr_prio.res3 = 0; in pqisrc_build_aio_R1_write()
482 if(rcb->cmdlen > sizeof(aio_req->cdb)) in pqisrc_build_aio_R1_write()
483 rcb->cmdlen = sizeof(aio_req->cdb); in pqisrc_build_aio_R1_write()
484 memcpy(aio_req->cdb, rcb->cdbp, rcb->cmdlen); in pqisrc_build_aio_R1_write()
485 aio_req->err_idx = aio_req->req_id; in pqisrc_build_aio_R1_write()
486 aio_req->cdb_len = rcb->cmdlen; in pqisrc_build_aio_R1_write()
487 aio_req->num_drives = LE_16(rcb->dvp->raid_map->layout_map_count); in pqisrc_build_aio_R1_write()
490 if (rcb->encrypt_enable == true) { in pqisrc_build_aio_R1_write()
491 aio_req->cmd_flags.encrypt_enable = true; in pqisrc_build_aio_R1_write()
492 aio_req->encrypt_key_index = in pqisrc_build_aio_R1_write()
493 LE_16(rcb->enc_info.data_enc_key_index); in pqisrc_build_aio_R1_write()
494 aio_req->encrypt_twk_low = in pqisrc_build_aio_R1_write()
495 LE_32(rcb->enc_info.encrypt_tweak_lower); in pqisrc_build_aio_R1_write()
496 aio_req->encrypt_twk_high = in pqisrc_build_aio_R1_write()
497 LE_32(rcb->enc_info.encrypt_tweak_upper); in pqisrc_build_aio_R1_write()
499 aio_req->cmd_flags.encrypt_enable = 0; in pqisrc_build_aio_R1_write()
500 aio_req->encrypt_key_index = 0; in pqisrc_build_aio_R1_write()
501 aio_req->encrypt_twk_high = 0; in pqisrc_build_aio_R1_write()
502 aio_req->encrypt_twk_low = 0; in pqisrc_build_aio_R1_write()
505 aio_req->cmd_flags.partial = pqisrc_build_sgl(&aio_req->sg_desc[0], rcb, in pqisrc_build_aio_R1_write()
506 &aio_req->header, num_elem_alloted); in pqisrc_build_aio_R1_write()
508 aio_req->num_sg = aio_req->header.iu_length / sizeof(sgt_t); in pqisrc_build_aio_R1_write()
510 /* DBG_INFO("aio_req->num_sg :%d\n", aio_req->num_sg); */ in pqisrc_build_aio_R1_write()
512 aio_req->header.iu_length += offsetof(pqi_aio_raid1_write_req_t, sg_desc) - in pqisrc_build_aio_R1_write()
516 rcb->success_cmp_callback = pqisrc_process_io_response_success; in pqisrc_build_aio_R1_write()
517 rcb->error_cmp_callback = pqisrc_process_aio_response_error; in pqisrc_build_aio_R1_write()
518 rcb->resp_qid = aio_req->response_queue_id; in pqisrc_build_aio_R1_write()
523 /*Subroutine used to show AIO RAID1 Write bypass IU fields */
530 DBG_INFO("AIO RAID1 Write IU Content, tag# 0x%08x", rcb->tag); in pqisrc_show_aio_R1_write()
531 DBG_INFO("%15s: 0x%x\n", "iu_type", aio_req->header.iu_type); in pqisrc_show_aio_R1_write()
532 DBG_INFO("%15s: 0x%x\n", "comp_feat", aio_req->header.comp_feature); in pqisrc_show_aio_R1_write()
533 DBG_INFO("%15s: 0x%x\n", "length", aio_req->header.iu_length); in pqisrc_show_aio_R1_write()
534 DBG_INFO("%15s: 0x%x\n", "resp_qid", aio_req->response_queue_id); in pqisrc_show_aio_R1_write()
535 DBG_INFO("%15s: 0x%x\n", "req_id", aio_req->req_id); in pqisrc_show_aio_R1_write()
536 DBG_INFO("%15s: 0x%x\n", "volume_id", aio_req->volume_id); in pqisrc_show_aio_R1_write()
537 DBG_INFO("%15s: 0x%x\n", "nexus_1", aio_req->nexus_1); in pqisrc_show_aio_R1_write()
538 DBG_INFO("%15s: 0x%x\n", "nexus_2", aio_req->nexus_2); in pqisrc_show_aio_R1_write()
539 DBG_INFO("%15s: 0x%x\n", "nexus_3", aio_req->nexus_3); in pqisrc_show_aio_R1_write()
540 DBG_INFO("%15s: 0x%x\n", "buf_len", aio_req->buf_len); in pqisrc_show_aio_R1_write()
542 DBG_INFO("%15s: 0x%x\n", "data_dir", aio_req->cmd_flags.data_dir); in pqisrc_show_aio_R1_write()
543 DBG_INFO("%15s: 0x%x\n", "partial", aio_req->cmd_flags.partial); in pqisrc_show_aio_R1_write()
544 DBG_INFO("%15s: 0x%x\n", "mem_type", aio_req->cmd_flags.mem_type); in pqisrc_show_aio_R1_write()
545 DBG_INFO("%15s: 0x%x\n", "fence", aio_req->cmd_flags.fence); in pqisrc_show_aio_R1_write()
547 aio_req->cmd_flags.encrypt_enable); in pqisrc_show_aio_R1_write()
549 DBG_INFO("%15s: 0x%x\n", "task_attr", aio_req->attr_prio.task_attr); in pqisrc_show_aio_R1_write()
550 DBG_INFO("%15s: 0x%x\n", "cmd_prio", aio_req->attr_prio.cmd_prio); in pqisrc_show_aio_R1_write()
551 DBG_INFO("%15s: 0x%x\n", "dek_index", aio_req->encrypt_key_index); in pqisrc_show_aio_R1_write()
552 pqisrc_show_cdb(softs, "AIOR1W", rcb, aio_req->cdb); in pqisrc_show_aio_R1_write()
553 DBG_INFO("%15s: 0x%x\n", "err_idx", aio_req->err_idx); in pqisrc_show_aio_R1_write()
554 DBG_INFO("%15s: 0x%x\n", "num_sg", aio_req->num_sg); in pqisrc_show_aio_R1_write()
555 DBG_INFO("%15s: 0x%x\n", "cdb_len", aio_req->cdb_len); in pqisrc_show_aio_R1_write()
556 DBG_INFO("%15s: 0x%x\n", "num_drives", aio_req->num_drives); in pqisrc_show_aio_R1_write()
557 DBG_INFO("%15s: 0x%x\n", "tweak_lower", aio_req->encrypt_twk_low); in pqisrc_show_aio_R1_write()
558 DBG_INFO("%15s: 0x%x\n", "tweak_upper", aio_req->encrypt_twk_high); in pqisrc_show_aio_R1_write()
561 (void *)aio_req->sg_desc[0].addr); in pqisrc_show_aio_R1_write()
563 aio_req->sg_desc[0].len); in pqisrc_show_aio_R1_write()
565 aio_req->sg_desc[0].flags); in pqisrc_show_aio_R1_write()
570 /*Subroutine used to populate AIO Raid5 or 6 write bypass IU */
581 num_data_disks = LE_16(rcb->dvp->raid_map->data_disks_per_row); in pqisrc_build_aio_R5or6_write()
582 num_metadata_disks = LE_16(rcb->dvp->raid_map->metadata_disks_per_row); in pqisrc_build_aio_R5or6_write()
585 index = PQISRC_DIV_ROUND_UP(rcb->raid_map_index + 1, total_disks); in pqisrc_build_aio_R5or6_write()
587 index -= num_metadata_disks; in pqisrc_build_aio_R5or6_write()
589 switch (rcb->dvp->raid_level) { in pqisrc_build_aio_R5or6_write()
591 aio_req->header.iu_type = in pqisrc_build_aio_R5or6_write()
595 aio_req->header.iu_type = in pqisrc_build_aio_R5or6_write()
601 aio_req->header.comp_feature = 0; in pqisrc_build_aio_R5or6_write()
602 aio_req->response_queue_id = OS_GET_IO_RESP_QID(softs, rcb); in pqisrc_build_aio_R5or6_write()
603 aio_req->work_area[0] = 0; in pqisrc_build_aio_R5or6_write()
604 aio_req->work_area[1] = 0; in pqisrc_build_aio_R5or6_write()
605 aio_req->req_id = rcb->tag; in pqisrc_build_aio_R5or6_write()
606 aio_req->volume_id = (LE_32(rcb->dvp->scsi3addr[0]) & 0x3FFF); in pqisrc_build_aio_R5or6_write()
607 aio_req->data_it_nexus = rcb->dvp->raid_map->dev_data[rcb->raid_map_index].ioaccel_handle; in pqisrc_build_aio_R5or6_write()
608 aio_req->p_parity_it_nexus = in pqisrc_build_aio_R5or6_write()
609 rcb->dvp->raid_map->dev_data[index].ioaccel_handle; in pqisrc_build_aio_R5or6_write()
610 if (aio_req->header.iu_type == in pqisrc_build_aio_R5or6_write()
612 aio_req->q_parity_it_nexus = in pqisrc_build_aio_R5or6_write()
613 rcb->dvp->raid_map->dev_data[index + 1].ioaccel_handle; in pqisrc_build_aio_R5or6_write()
615 aio_req->xor_multiplier = in pqisrc_build_aio_R5or6_write()
616 rcb->dvp->raid_map->dev_data[rcb->raid_map_index].xor_mult[1]; in pqisrc_build_aio_R5or6_write()
617 aio_req->row = rcb->row_num; in pqisrc_build_aio_R5or6_write()
618 /*aio_req->reserved = rcb->row_num * rcb->blocks_per_row + in pqisrc_build_aio_R5or6_write()
619 rcb->dvp->raid_map->disk_starting_blk;*/ in pqisrc_build_aio_R5or6_write()
620 aio_req->buf_len = GET_SCSI_BUFFLEN(rcb); in pqisrc_build_aio_R5or6_write()
621 aio_req->cmd_flags.data_dir = rcb->data_dir; in pqisrc_build_aio_R5or6_write()
622 aio_req->cmd_flags.mem_type = 0; in pqisrc_build_aio_R5or6_write()
623 aio_req->cmd_flags.fence = 0; in pqisrc_build_aio_R5or6_write()
624 aio_req->cmd_flags.res2 = 0; in pqisrc_build_aio_R5or6_write()
625 aio_req->attr_prio.task_attr = OS_GET_TASK_ATTR(rcb); in pqisrc_build_aio_R5or6_write()
626 aio_req->attr_prio.cmd_prio = 0; in pqisrc_build_aio_R5or6_write()
627 aio_req->attr_prio.res3 = 0; in pqisrc_build_aio_R5or6_write()
628 if (rcb->cmdlen > sizeof(aio_req->cdb)) in pqisrc_build_aio_R5or6_write()
629 rcb->cmdlen = sizeof(aio_req->cdb); in pqisrc_build_aio_R5or6_write()
630 memcpy(aio_req->cdb, rcb->cdbp, rcb->cmdlen); in pqisrc_build_aio_R5or6_write()
631 aio_req->err_idx = aio_req->req_id; in pqisrc_build_aio_R5or6_write()
632 aio_req->cdb_len = rcb->cmdlen; in pqisrc_build_aio_R5or6_write()
635 aio_req->header.iu_type = iu_type; in pqisrc_build_aio_R5or6_write()
636 aio_req->data_it_nexus = ; in pqisrc_build_aio_R5or6_write()
637 aio_req->p_parity_it_nexus = ; in pqisrc_build_aio_R5or6_write()
638 aio_req->q_parity_it_nexus = ; in pqisrc_build_aio_R5or6_write()
639 aio_req->row = ; in pqisrc_build_aio_R5or6_write()
640 aio_req->stripe_lba = ; in pqisrc_build_aio_R5or6_write()
643 if (rcb->encrypt_enable == true) { in pqisrc_build_aio_R5or6_write()
644 aio_req->cmd_flags.encrypt_enable = true; in pqisrc_build_aio_R5or6_write()
645 aio_req->encrypt_key_index = in pqisrc_build_aio_R5or6_write()
646 LE_16(rcb->enc_info.data_enc_key_index); in pqisrc_build_aio_R5or6_write()
647 aio_req->encrypt_twk_low = in pqisrc_build_aio_R5or6_write()
648 LE_32(rcb->enc_info.encrypt_tweak_lower); in pqisrc_build_aio_R5or6_write()
649 aio_req->encrypt_twk_high = in pqisrc_build_aio_R5or6_write()
650 LE_32(rcb->enc_info.encrypt_tweak_upper); in pqisrc_build_aio_R5or6_write()
652 aio_req->cmd_flags.encrypt_enable = 0; in pqisrc_build_aio_R5or6_write()
653 aio_req->encrypt_key_index = 0; in pqisrc_build_aio_R5or6_write()
654 aio_req->encrypt_twk_high = 0; in pqisrc_build_aio_R5or6_write()
655 aio_req->encrypt_twk_low = 0; in pqisrc_build_aio_R5or6_write()
658 aio_req->cmd_flags.partial = pqisrc_build_sgl(&aio_req->sg_desc[0], rcb, in pqisrc_build_aio_R5or6_write()
659 &aio_req->header, num_elem_alloted); in pqisrc_build_aio_R5or6_write()
661 aio_req->num_sg = aio_req->header.iu_length / sizeof(sgt_t); in pqisrc_build_aio_R5or6_write()
663 /* DBG_INFO("aio_req->num_sg :%d\n", aio_req->num_sg); */ in pqisrc_build_aio_R5or6_write()
665 aio_req->header.iu_length += offsetof(pqi_aio_raid5or6_write_req_t, sg_desc) - in pqisrc_build_aio_R5or6_write()
668 rcb->success_cmp_callback = pqisrc_process_io_response_success; in pqisrc_build_aio_R5or6_write()
669 rcb->error_cmp_callback = pqisrc_process_aio_response_error; in pqisrc_build_aio_R5or6_write()
670 rcb->resp_qid = aio_req->response_queue_id; in pqisrc_build_aio_R5or6_write()
675 /*Subroutine used to show AIO RAID5/6 Write bypass IU fields */
681 DBG_INFO("AIO RAID5or6 Write IU Content, tag# 0x%08x\n", rcb->tag); in pqisrc_show_aio_R5or6_write()
682 DBG_INFO("%15s: 0x%x\n", "iu_type", aio_req->header.iu_type); in pqisrc_show_aio_R5or6_write()
683 DBG_INFO("%15s: 0x%x\n", "comp_feat", aio_req->header.comp_feature); in pqisrc_show_aio_R5or6_write()
684 DBG_INFO("%15s: 0x%x\n", "length", aio_req->header.iu_length); in pqisrc_show_aio_R5or6_write()
685 DBG_INFO("%15s: 0x%x\n", "resp_qid", aio_req->response_queue_id); in pqisrc_show_aio_R5or6_write()
686 DBG_INFO("%15s: 0x%x\n", "req_id", aio_req->req_id); in pqisrc_show_aio_R5or6_write()
687 DBG_INFO("%15s: 0x%x\n", "volume_id", aio_req->volume_id); in pqisrc_show_aio_R5or6_write()
689 aio_req->data_it_nexus); in pqisrc_show_aio_R5or6_write()
691 aio_req->p_parity_it_nexus); in pqisrc_show_aio_R5or6_write()
693 aio_req->q_parity_it_nexus); in pqisrc_show_aio_R5or6_write()
694 DBG_INFO("%15s: 0x%x\n", "buf_len", aio_req->buf_len); in pqisrc_show_aio_R5or6_write()
696 DBG_INFO("%15s: 0x%x\n", "data_dir", aio_req->cmd_flags.data_dir); in pqisrc_show_aio_R5or6_write()
697 DBG_INFO("%15s: 0x%x\n", "partial", aio_req->cmd_flags.partial); in pqisrc_show_aio_R5or6_write()
698 DBG_INFO("%15s: 0x%x\n", "mem_type", aio_req->cmd_flags.mem_type); in pqisrc_show_aio_R5or6_write()
699 DBG_INFO("%15s: 0x%x\n", "fence", aio_req->cmd_flags.fence); in pqisrc_show_aio_R5or6_write()
701 aio_req->cmd_flags.encrypt_enable); in pqisrc_show_aio_R5or6_write()
703 DBG_INFO("%15s: 0x%x\n", "task_attr", aio_req->attr_prio.task_attr); in pqisrc_show_aio_R5or6_write()
704 DBG_INFO("%15s: 0x%x\n", "cmd_prio", aio_req->attr_prio.cmd_prio); in pqisrc_show_aio_R5or6_write()
705 DBG_INFO("%15s: 0x%x\n", "dek_index", aio_req->encrypt_key_index); in pqisrc_show_aio_R5or6_write()
706 pqisrc_show_cdb(softs, "AIOR56W", rcb, aio_req->cdb); in pqisrc_show_aio_R5or6_write()
707 DBG_INFO("%15s: 0x%x\n", "err_idx", aio_req->err_idx); in pqisrc_show_aio_R5or6_write()
708 DBG_INFO("%15s: 0x%x\n", "num_sg", aio_req->num_sg); in pqisrc_show_aio_R5or6_write()
709 DBG_INFO("%15s: 0x%x\n", "cdb_len", aio_req->cdb_len); in pqisrc_show_aio_R5or6_write()
710 DBG_INFO("%15s: 0x%x\n", "tweak_lower", aio_req->encrypt_twk_low); in pqisrc_show_aio_R5or6_write()
711 DBG_INFO("%15s: 0x%x\n", "tweak_upper", aio_req->encrypt_twk_high); in pqisrc_show_aio_R5or6_write()
712 DBG_INFO("%15s: 0x%lx\n", "row", aio_req->row); in pqisrc_show_aio_R5or6_write()
714 DBG_INFO("%15s: 0x%lx\n", "stripe_lba", aio_req->stripe_lba); in pqisrc_show_aio_R5or6_write()
716 (void *)aio_req->sg_desc[0].addr); in pqisrc_show_aio_R5or6_write()
718 aio_req->sg_desc[0].len); in pqisrc_show_aio_R5or6_write()
720 aio_req->sg_desc[0].flags); in pqisrc_show_aio_R5or6_write()
756 is_write = pqisrc_cdb_is_write(rcb->cdbp); in pqisrc_show_aio_io()
763 switch (rcb->dvp->raid_level) { in pqisrc_show_aio_io()
792 is_write = pqisrc_cdb_is_write(rcb->cdbp); in pqisrc_build_aio_io()
795 switch (rcb->dvp->raid_level) { in pqisrc_build_aio_io()
841 rc = fill_lba_for_scsi_rw(softs, rcb->cdbp , &loc); in pqisrc_is_parity_write_stream()
847 if (!pqisrc_cdb_is_write(rcb->cdbp)) { in pqisrc_is_parity_write_stream()
851 if (!softs->enable_stream_detection) { in pqisrc_is_parity_write_stream()
855 device = rcb->dvp; in pqisrc_is_parity_write_stream()
863 if (device->raid_level != SA_RAID_5 && device->raid_level != SA_RAID_6) { in pqisrc_is_parity_write_stream()
869 * requests down non-aio path. in pqisrc_is_parity_write_stream()
871 if ((device->raid_level == SA_RAID_5 && !softs->aio_raid5_write_bypass) || in pqisrc_is_parity_write_stream()
872 (device->raid_level == SA_RAID_6 && !softs->aio_raid6_write_bypass)) { in pqisrc_is_parity_write_stream()
879 pqi_stream_data = &device->stream_data[i]; in pqisrc_is_parity_write_stream()
884 if ((pqi_stream_data->next_lba && in pqisrc_is_parity_write_stream()
885 loc.block.first >= pqi_stream_data->next_lba) && in pqisrc_is_parity_write_stream()
886 loc.block.first <= pqi_stream_data->next_lba + in pqisrc_is_parity_write_stream()
888 pqi_stream_data->next_lba = loc.block.first + in pqisrc_is_parity_write_stream()
890 pqi_stream_data->last_accessed = TICKS; in pqisrc_is_parity_write_stream()
895 if (pqi_stream_data->last_accessed == 0) { in pqisrc_is_parity_write_stream()
901 if (pqi_stream_data->last_accessed <= oldest_ticks) { in pqisrc_is_parity_write_stream()
902 oldest_ticks = pqi_stream_data->last_accessed; in pqisrc_is_parity_write_stream()
910 pqi_stream_data = &device->stream_data[lru_index]; in pqisrc_is_parity_write_stream()
911 pqi_stream_data->last_accessed = TICKS; in pqisrc_is_parity_write_stream()
912 pqi_stream_data->next_lba = loc.block.first + loc.block.cnt; in pqisrc_is_parity_write_stream()
929 pqi_scsi_dev_t *devp = rcb->dvp; in determine_io_path_build_bypass()
934 rcb->cdbp = OS_GET_CDBP(rcb); in determine_io_path_build_bypass()
936 if(!rcb->aio_retry) { in determine_io_path_build_bypass()
940 rcb->ioaccel_handle = devp->ioaccel_handle; in determine_io_path_build_bypass()
944 /** IO for RAID Volume, ByPass IO, Send in AIO PATH unless part of stream **/ in determine_io_path_build_bypass()
945 if (devp->offload_enabled && !pqisrc_is_parity_write_stream(softs, rcb)) { in determine_io_path_build_bypass()
952 ASSERT(rcb->cdbp == rcb->bypass_cdb); in determine_io_path_build_bypass()
965 switch (rcb->cm_ccb->ccb_h.flags & CAM_DIR_MASK) { in pqisrc_get_aio_data_direction()
976 switch (rcb->cm_ccb->ccb_h.flags & CAM_DIR_MASK) { in pqisrc_get_raid_data_direction()
988 ib_queue_t *ib_q_array = softs->op_aio_ib_q; in pqisrc_build_send_io()
995 uint32_t num_op_ib_q = softs->num_op_aio_ibq; in pqisrc_build_send_io()
998 pqi_scsi_dev_t *devp = rcb->dvp; in pqisrc_build_send_io()
1009 rcb->data_dir = pqisrc_get_raid_data_direction(rcb); in pqisrc_build_send_io()
1010 num_op_ib_q = softs->num_op_raid_ibq; in pqisrc_build_send_io()
1011 ib_q_array = softs->op_raid_ib_q; in pqisrc_build_send_io()
1014 rcb->data_dir = pqisrc_get_aio_data_direction(rcb); in pqisrc_build_send_io()
1015 if (rcb->data_dir == SOP_DATA_DIR_UNKNOWN) { in pqisrc_build_send_io()
1020 is_write = pqisrc_cdb_is_write(rcb->cdbp); in pqisrc_build_send_io()
1029 PQI_LOCK(&ib_q->lock); in pqisrc_build_send_io()
1030 num_elem_available = pqisrc_contiguous_free_elem(ib_q->pi_local, in pqisrc_build_send_io()
1031 *(ib_q->ci_virt_addr), ib_q->num_elem); in pqisrc_build_send_io()
1040 PQI_UNLOCK(&ib_q->lock); in pqisrc_build_send_io()
1058 /* Get IB Queue Slot address to build IU */ in pqisrc_build_send_io()
1059 ib_iu = ib_q->array_virt_addr + (ib_q->pi_local * ib_q->elem_size); in pqisrc_build_send_io()
1071 rcb->req_pending = true; in pqisrc_build_send_io()
1072 rcb->req_q = ib_q; in pqisrc_build_send_io()
1073 rcb->path = io_path; in pqisrc_build_send_io()
1078 ib_q->pi_local = (ib_q->pi_local + num_elem_alloted) % ib_q->num_elem; in pqisrc_build_send_io()
1080 DBG_IO("ib_q->pi_local : %x\n", ib_q->pi_local); in pqisrc_build_send_io()
1081 DBG_IO("*ib_q->ci_virt_addr: %x\n",*(ib_q->ci_virt_addr)); in pqisrc_build_send_io()
1084 PCI_MEM_PUT32(softs, ib_q->pi_register_abs, ib_q->pi_register_offset, ib_q->pi_local); in pqisrc_build_send_io()
1086 PQI_UNLOCK(&ib_q->lock); in pqisrc_build_send_io()
1091 /* Subroutine used to set encryption info as part of RAID bypass IO*/
1103 volume_blk_size = GET_LE32((uint8_t *)&raid_map->volume_blk_size); in pqisrc_set_enc_info()
1107 enc_info->data_enc_key_index = in pqisrc_set_enc_info()
1108 GET_LE16((uint8_t *)&raid_map->data_encryption_key_index); in pqisrc_set_enc_info()
1109 enc_info->encrypt_tweak_upper = ((uint32_t)(((first_block) >> 16) >> 16)); in pqisrc_set_enc_info()
1110 enc_info->encrypt_tweak_lower = ((uint32_t)(first_block)); in pqisrc_set_enc_info()
1128 /* Subroutine used to parse the scsi opcode and build the CDB for RAID bypass*/
1134 DBG_INFO("No locator ptr: AIO ineligible"); in fill_lba_for_scsi_rw()
1143 l->is_write = true; in fill_lba_for_scsi_rw()
1146 l->block.first = (uint64_t)(((cdb[1] & 0x1F) << 16) | in fill_lba_for_scsi_rw()
1148 l->block.cnt = (uint32_t)cdb[4]; in fill_lba_for_scsi_rw()
1149 if (l->block.cnt == 0) in fill_lba_for_scsi_rw()
1150 l->block.cnt = 256; /*blkcnt 0 means 256 */ in fill_lba_for_scsi_rw()
1153 l->is_write = true; in fill_lba_for_scsi_rw()
1156 l->block.first = (uint64_t)GET_BE32(&cdb[2]); in fill_lba_for_scsi_rw()
1157 l->block.cnt = (uint32_t)GET_BE16(&cdb[7]); in fill_lba_for_scsi_rw()
1160 l->is_write = true; in fill_lba_for_scsi_rw()
1163 l->block.first = (uint64_t)GET_BE32(&cdb[2]); in fill_lba_for_scsi_rw()
1164 l->block.cnt = GET_BE32(&cdb[6]); in fill_lba_for_scsi_rw()
1167 l->is_write = true; in fill_lba_for_scsi_rw()
1170 l->block.first = GET_BE64(&cdb[2]); in fill_lba_for_scsi_rw()
1171 l->block.cnt = GET_BE32(&cdb[10]); in fill_lba_for_scsi_rw()
1191 if (device->raid_level == SA_RAID_0) in pqisrc_is_supported_write()
1198 if (!softs->adv_aio_capable) in pqisrc_is_supported_write()
1201 /* if the raid write bypass feature is turned on, in pqisrc_is_supported_write()
1204 switch (device->raid_level) { in pqisrc_is_supported_write()
1207 if (softs->aio_raid1_write_bypass) in pqisrc_is_supported_write()
1211 if (softs->aio_raid5_write_bypass) in pqisrc_is_supported_write()
1215 if (softs->aio_raid6_write_bypass) in pqisrc_is_supported_write()
1226 /* check for zero-byte transfers, invalid blocks, and wraparound */
1232 if (l->block.cnt == 0) { in pqisrc_is_invalid_block()
1238 if (l->block.last < l->block.first || in pqisrc_is_invalid_block()
1239 l->block.last >= in pqisrc_is_invalid_block()
1240 GET_LE64((uint8_t *)&l->raid_map->volume_blk_cnt)) { in pqisrc_is_invalid_block()
1257 l->row.data_disks = in pqisrc_calc_disk_params()
1258 GET_LE16((uint8_t *)&l->raid_map->data_disks_per_row); in pqisrc_calc_disk_params()
1259 l->strip_sz = in pqisrc_calc_disk_params()
1260 GET_LE16((uint8_t *)(&l->raid_map->strip_size)); in pqisrc_calc_disk_params()
1261 l->map.layout_map_count = in pqisrc_calc_disk_params()
1262 GET_LE16((uint8_t *)(&l->raid_map->layout_map_count)); in pqisrc_calc_disk_params()
1265 l->row.blks_per_row = l->row.data_disks * l->strip_sz; in pqisrc_calc_disk_params()
1266 if (!l->row.blks_per_row || !l->strip_sz) { in pqisrc_calc_disk_params()
1272 rcb->blocks_per_row = l->row.blks_per_row; in pqisrc_calc_disk_params()
1273 l->row.first = l->block.first / l->row.blks_per_row; in pqisrc_calc_disk_params()
1274 rcb->row_num = l->row.first; in pqisrc_calc_disk_params()
1275 l->row.last = l->block.last / l->row.blks_per_row; in pqisrc_calc_disk_params()
1276 l->row.offset_first = (uint32_t)(l->block.first - in pqisrc_calc_disk_params()
1277 (l->row.first * l->row.blks_per_row)); in pqisrc_calc_disk_params()
1278 l->row.offset_last = (uint32_t)(l->block.last - in pqisrc_calc_disk_params()
1279 (l->row.last * l->row.blks_per_row)); in pqisrc_calc_disk_params()
1280 l->col.first = l->row.offset_first / l->strip_sz; in pqisrc_calc_disk_params()
1281 l->col.last = l->row.offset_last / l->strip_sz; in pqisrc_calc_disk_params()
1287 /* Not AIO-eligible if it isn't a single row/column. */
1294 if (l->row.first != l->row.last || l->col.first != l->col.last) { in pqisrc_is_single_row_column()
1306 if (!l->row.data_disks) { in pqisrc_set_map_row_and_idx()
1307 DBG_INFO("AIO ineligible: no data disks?\n"); in pqisrc_set_map_row_and_idx()
1311 l->row.total_disks = l->row.data_disks + in pqisrc_set_map_row_and_idx()
1312 LE_16(l->raid_map->metadata_disks_per_row); in pqisrc_set_map_row_and_idx()
1314 l->map.row = ((uint32_t)(l->row.first >> in pqisrc_set_map_row_and_idx()
1315 l->raid_map->parity_rotation_shift)) % in pqisrc_set_map_row_and_idx()
1316 GET_LE16((uint8_t *)(&l->raid_map->row_cnt)); in pqisrc_set_map_row_and_idx()
1318 l->map.idx = (l->map.row * l->row.total_disks) + l->col.first; in pqisrc_set_map_row_and_idx()
1319 rcb->raid_map_index = l->map.idx; in pqisrc_set_map_row_and_idx()
1320 rcb->raid_map_row = l->map.row; in pqisrc_set_map_row_and_idx()
1330 /* Avoid direct use of device->offload_to_mirror within this in pqisrc_set_read_mirror()
1332 * increment it beyond the range of device->layout_map_count -1. in pqisrc_set_read_mirror()
1335 int mirror = device->offload_to_mirror[l->map.idx]; in pqisrc_set_read_mirror()
1338 if (next_mirror >= l->map.layout_map_count) in pqisrc_set_read_mirror()
1341 device->offload_to_mirror[l->map.idx] = next_mirror; in pqisrc_set_read_mirror()
1342 l->map.idx += mirror * l->row.data_disks; in pqisrc_set_read_mirror()
1356 if (l->map.layout_map_count > PQISRC_MAX_SUPPORTED_MIRRORS) in pqisrc_set_write_mirrors()
1360 index = l->map.idx + (l->row.data_disks * mirror); in pqisrc_set_write_mirrors()
1361 rcb->it_nexus[mirror] = in pqisrc_set_write_mirrors()
1362 l->raid_map->dev_data[index].ioaccel_handle; in pqisrc_set_write_mirrors()
1364 } while (mirror != l->map.layout_map_count); in pqisrc_set_write_mirrors()
1376 l->r5or6.row.blks_per_row = l->strip_sz * l->row.data_disks; in pqisrc_is_r5or6_single_group()
1377 l->stripesz = l->r5or6.row.blks_per_row * l->map.layout_map_count; in pqisrc_is_r5or6_single_group()
1378 l->group.first = (l->block.first % l->stripesz) / in pqisrc_is_r5or6_single_group()
1379 l->r5or6.row.blks_per_row; in pqisrc_is_r5or6_single_group()
1380 l->group.last = (l->block.last % l->stripesz) / in pqisrc_is_r5or6_single_group()
1381 l->r5or6.row.blks_per_row; in pqisrc_is_r5or6_single_group()
1383 if (l->group.first != l->group.last) { in pqisrc_is_r5or6_single_group()
1401 l->row.first = l->r5or6.row.first = in pqisrc_is_r5or6_single_row()
1402 l->block.first / l->stripesz; in pqisrc_is_r5or6_single_row()
1403 l->r5or6.row.last = l->block.last / l->stripesz; in pqisrc_is_r5or6_single_row()
1405 if (l->r5or6.row.first != l->r5or6.row.last) { in pqisrc_is_r5or6_single_row()
1422 l->row.offset_first = l->r5or6.row.offset_first = in pqisrc_is_r5or6_single_column()
1423 (uint32_t)((l->block.first % l->stripesz) % in pqisrc_is_r5or6_single_column()
1424 l->r5or6.row.blks_per_row); in pqisrc_is_r5or6_single_column()
1425 l->r5or6.row.offset_last = in pqisrc_is_r5or6_single_column()
1426 (uint32_t)((l->block.last % l->stripesz) % in pqisrc_is_r5or6_single_column()
1427 l->r5or6.row.blks_per_row); in pqisrc_is_r5or6_single_column()
1429 l->col.first = l->r5or6.row.offset_first / l->strip_sz; in pqisrc_is_r5or6_single_column()
1430 l->r5or6.col.first = l->col.first; in pqisrc_is_r5or6_single_column()
1431 l->r5or6.col.last = l->r5or6.row.offset_last / l->strip_sz; in pqisrc_is_r5or6_single_column()
1433 if (l->r5or6.col.first != l->r5or6.col.last) { in pqisrc_is_r5or6_single_column()
1448 l->map.row = ((uint32_t) in pqisrc_set_r5or6_row_and_index()
1449 (l->row.first >> l->raid_map->parity_rotation_shift)) % in pqisrc_set_r5or6_row_and_index()
1450 GET_LE16((uint8_t *)(&l->raid_map->row_cnt)); in pqisrc_set_r5or6_row_and_index()
1452 l->map.idx = (l->group.first * in pqisrc_set_r5or6_row_and_index()
1453 (GET_LE16((uint8_t *)(&l->raid_map->row_cnt)) in pqisrc_set_r5or6_row_and_index()
1454 * l->row.total_disks)) in pqisrc_set_r5or6_row_and_index()
1455 + (l->map.row * l->row.total_disks) in pqisrc_set_r5or6_row_and_index()
1456 + l->col.first; in pqisrc_set_r5or6_row_and_index()
1458 rcb->raid_map_index = l->map.idx; in pqisrc_set_r5or6_row_and_index()
1459 rcb->raid_map_row = l->map.row; in pqisrc_set_r5or6_row_and_index()
1468 l->block.disk_block = in pqisrc_calc_aio_block()
1469 GET_LE64((uint8_t *) (&l->raid_map->disk_starting_blk)) in pqisrc_calc_aio_block()
1470 + (l->row.first * l->strip_sz) in pqisrc_calc_aio_block()
1471 + ((uint64_t)(l->row.offset_first) - (uint64_t)(l->col.first) * l->strip_sz); in pqisrc_calc_aio_block()
1482 disk_blk_cnt = l->block.cnt; in pqisrc_handle_blk_size_diffs()
1484 if (l->raid_map->phys_blk_shift) { in pqisrc_handle_blk_size_diffs()
1485 l->block.disk_block <<= l->raid_map->phys_blk_shift; in pqisrc_handle_blk_size_diffs()
1486 disk_blk_cnt <<= l->raid_map->phys_blk_shift; in pqisrc_handle_blk_size_diffs()
1502 uint32_t size = disk_blk_cnt * device->raid_map->volume_blk_size; in pqisrc_aio_req_too_big()
1506 if (device->is_nvme && rcb->encrypt_enable) { in pqisrc_aio_req_too_big()
1507 if (softs->max_aio_rw_xfer_crypto_nvme != 0) { in pqisrc_aio_req_too_big()
1508 dev_max = MIN(dev_max,softs->max_aio_rw_xfer_crypto_nvme); in pqisrc_aio_req_too_big()
1513 if (!device->is_physical_device && in pqisrc_aio_req_too_big()
1514 (device->raid_level == SA_RAID_5 || in pqisrc_aio_req_too_big()
1515 device->raid_level == SA_RAID_51 || in pqisrc_aio_req_too_big()
1516 device->raid_level == SA_RAID_6)) { in pqisrc_aio_req_too_big()
1517 if (softs->max_aio_write_raid5_6 != 0) { in pqisrc_aio_req_too_big()
1518 dev_max = MIN(dev_max,softs->max_aio_write_raid5_6); in pqisrc_aio_req_too_big()
1523 if (!device->is_physical_device && in pqisrc_aio_req_too_big()
1524 (device->raid_level == SA_RAID_ADM) && in pqisrc_aio_req_too_big()
1525 (softs->max_aio_write_raid1_10_3drv != 0)) { in pqisrc_aio_req_too_big()
1527 softs->max_aio_write_raid1_10_3drv); in pqisrc_aio_req_too_big()
1531 if (!device->is_physical_device && in pqisrc_aio_req_too_big()
1532 (device->raid_level == SA_RAID_1) && in pqisrc_aio_req_too_big()
1533 (softs->max_aio_write_raid1_10_2drv != 0)) { in pqisrc_aio_req_too_big()
1535 softs->max_aio_write_raid1_10_2drv); in pqisrc_aio_req_too_big()
1555 DBG_WARN("No RAID MAP!\n"); in pqisrc_aio_show_raid_map()
1559 DBG_INFO("%-25s: 0x%x\n", "StructureSize", m->structure_size); in pqisrc_aio_show_raid_map()
1560 DBG_INFO("%-25s: 0x%x\n", "LogicalBlockSize", m->volume_blk_size); in pqisrc_aio_show_raid_map()
1561 DBG_INFO("%-25s: 0x%lx\n", "LogicalBlockCount", m->volume_blk_cnt); in pqisrc_aio_show_raid_map()
1562 DBG_INFO("%-25s: 0x%x\n", "PhysicalBlockShift", m->phys_blk_shift); in pqisrc_aio_show_raid_map()
1563 DBG_INFO("%-25s: 0x%x\n", "ParityRotationShift", in pqisrc_aio_show_raid_map()
1564 m->parity_rotation_shift); in pqisrc_aio_show_raid_map()
1565 DBG_INFO("%-25s: 0x%x\n", "StripSize", m->strip_size); in pqisrc_aio_show_raid_map()
1566 DBG_INFO("%-25s: 0x%lx\n", "DiskStartingBlock", m->disk_starting_blk); in pqisrc_aio_show_raid_map()
1567 DBG_INFO("%-25s: 0x%lx\n", "DiskBlockCount", m->disk_blk_cnt); in pqisrc_aio_show_raid_map()
1568 DBG_INFO("%-25s: 0x%x\n", "DataDisksPerRow", m->data_disks_per_row); in pqisrc_aio_show_raid_map()
1569 DBG_INFO("%-25s: 0x%x\n", "MetdataDisksPerRow", in pqisrc_aio_show_raid_map()
1570 m->metadata_disks_per_row); in pqisrc_aio_show_raid_map()
1571 DBG_INFO("%-25s: 0x%x\n", "RowCount", m->row_cnt); in pqisrc_aio_show_raid_map()
1572 DBG_INFO("%-25s: 0x%x\n", "LayoutMapCnt", m->layout_map_count); in pqisrc_aio_show_raid_map()
1573 DBG_INFO("%-25s: 0x%x\n", "fEncryption", m->flags); in pqisrc_aio_show_raid_map()
1574 DBG_INFO("%-25s: 0x%x\n", "DEK", m->data_encryption_key_index); in pqisrc_aio_show_raid_map()
1576 if (m->dev_data[i].ioaccel_handle == 0) in pqisrc_aio_show_raid_map()
1578 DBG_INFO("%-25s: %d: 0x%04x\n", "ioaccel_handle, disk", in pqisrc_aio_show_raid_map()
1579 i, m->dev_data[i].ioaccel_handle); in pqisrc_aio_show_raid_map()
1589 pqisrc_aio_show_raid_map(softs, l->raid_map); in pqisrc_aio_show_locator_info()
1591 DBG_INFO("======= AIO Locator Content, tag#0x%08x =====\n", rcb->tag); in pqisrc_aio_show_locator_info()
1592 DBG_INFO("%-25s: 0x%lx\n", "block.first", l->block.first); in pqisrc_aio_show_locator_info()
1593 DBG_INFO("%-25s: 0x%lx\n", "block.last", l->block.last); in pqisrc_aio_show_locator_info()
1594 DBG_INFO("%-25s: 0x%x\n", "block.cnt", l->block.cnt); in pqisrc_aio_show_locator_info()
1595 DBG_INFO("%-25s: 0x%lx\n", "block.disk_block", l->block.disk_block); in pqisrc_aio_show_locator_info()
1596 DBG_INFO("%-25s: 0x%x\n", "row.blks_per_row", l->row.blks_per_row); in pqisrc_aio_show_locator_info()
1597 DBG_INFO("%-25s: 0x%lx\n", "row.first", l->row.first); in pqisrc_aio_show_locator_info()
1598 DBG_INFO("%-25s: 0x%lx\n", "row.last", l->row.last); in pqisrc_aio_show_locator_info()
1599 DBG_INFO("%-25s: 0x%x\n", "row.offset_first", l->row.offset_first); in pqisrc_aio_show_locator_info()
1600 DBG_INFO("%-25s: 0x%x\n", "row.offset_last", l->row.offset_last); in pqisrc_aio_show_locator_info()
1601 DBG_INFO("%-25s: 0x%x\n", "row.data_disks", l->row.data_disks); in pqisrc_aio_show_locator_info()
1602 DBG_INFO("%-25s: 0x%x\n", "row.total_disks", l->row.total_disks); in pqisrc_aio_show_locator_info()
1603 DBG_INFO("%-25s: 0x%x\n", "col.first", l->col.first); in pqisrc_aio_show_locator_info()
1604 DBG_INFO("%-25s: 0x%x\n", "col.last", l->col.last); in pqisrc_aio_show_locator_info()
1606 if (l->raid_level == SA_RAID_5 || l->raid_level == SA_RAID_6) { in pqisrc_aio_show_locator_info()
1607 DBG_INFO("%-25s: 0x%x\n", "r5or6.row.blks_per_row", in pqisrc_aio_show_locator_info()
1608 l->r5or6.row.blks_per_row); in pqisrc_aio_show_locator_info()
1609 DBG_INFO("%-25s: 0x%lx\n", "r5or6.row.first", l->r5or6.row.first); in pqisrc_aio_show_locator_info()
1610 DBG_INFO("%-25s: 0x%lx\n", "r5or6.row.last", l->r5or6.row.last); in pqisrc_aio_show_locator_info()
1611 DBG_INFO("%-25s: 0x%x\n", "r5or6.row.offset_first", in pqisrc_aio_show_locator_info()
1612 l->r5or6.row.offset_first); in pqisrc_aio_show_locator_info()
1613 DBG_INFO("%-25s: 0x%x\n", "r5or6.row.offset_last", in pqisrc_aio_show_locator_info()
1614 l->r5or6.row.offset_last); in pqisrc_aio_show_locator_info()
1615 DBG_INFO("%-25s: 0x%x\n", "r5or6.row.data_disks", in pqisrc_aio_show_locator_info()
1616 l->r5or6.row.data_disks); in pqisrc_aio_show_locator_info()
1617 DBG_INFO("%-25s: 0x%x\n", "r5or6.row.total_disks", in pqisrc_aio_show_locator_info()
1618 l->r5or6.row.total_disks); in pqisrc_aio_show_locator_info()
1619 DBG_INFO("%-25s: 0x%x\n", "r5or6.col.first", l->r5or6.col.first); in pqisrc_aio_show_locator_info()
1620 DBG_INFO("%-25s: 0x%x\n", "r5or6.col.last", l->r5or6.col.last); in pqisrc_aio_show_locator_info()
1622 DBG_INFO("%-25s: 0x%x\n", "map.row", l->map.row); in pqisrc_aio_show_locator_info()
1623 DBG_INFO("%-25s: 0x%x\n", "map.idx", l->map.idx); in pqisrc_aio_show_locator_info()
1624 DBG_INFO("%-25s: 0x%x\n", "map.layout_map_count", in pqisrc_aio_show_locator_info()
1625 l->map.layout_map_count); in pqisrc_aio_show_locator_info()
1626 DBG_INFO("%-25s: 0x%x\n", "group.first", l->group.first); in pqisrc_aio_show_locator_info()
1627 DBG_INFO("%-25s: 0x%x\n", "group.last", l->group.last); in pqisrc_aio_show_locator_info()
1628 DBG_INFO("%-25s: 0x%x\n", "group.cur", l->group.cur); in pqisrc_aio_show_locator_info()
1629 DBG_INFO("%-25s: %d\n", "is_write", l->is_write); in pqisrc_aio_show_locator_info()
1630 DBG_INFO("%-25s: 0x%x\n", "stripesz", l->stripesz); in pqisrc_aio_show_locator_info()
1631 DBG_INFO("%-25s: 0x%x\n", "strip_sz", l->strip_sz); in pqisrc_aio_show_locator_info()
1632 DBG_INFO("%-25s: %d\n", "offload_to_mirror", l->offload_to_mirror); in pqisrc_aio_show_locator_info()
1633 DBG_INFO("%-25s: %d\n", "raid_level", l->raid_level); in pqisrc_aio_show_locator_info()
1645 if (l->block.disk_block > 0xffffffff) { in pqisrc_aio_build_cdb()
1646 cdb[0] = l->is_write ? SCMD_WRITE_16 : SCMD_READ_16; in pqisrc_aio_build_cdb()
1648 PUT_BE64(l->block.disk_block, &cdb[2]); in pqisrc_aio_build_cdb()
1653 cdb[0] = l->is_write ? SCMD_WRITE_10 : SCMD_READ_10; in pqisrc_aio_build_cdb()
1655 PUT_BE32(l->block.disk_block, &cdb[2]); in pqisrc_aio_build_cdb()
1662 rcb->cmdlen = cdb_length; in pqisrc_aio_build_cdb()
1689 line_len += snprintf(line_buf + line_len, (LINE_BUF_LEN - line_len), "%02d ", ii); in pqisrc_print_buffer()
1704 line_len += snprintf(line_buf + line_len, (LINE_BUF_LEN - line_len), "%02x ", this_char); in pqisrc_print_buffer()
1719 pqisrc_print_buffer(softs, msg, cdb, rcb->cmdlen, PRINT_FLAG_HDR_COLUMN); in pqisrc_show_cdb()
1727 if (rcb == NULL || rcb->dvp == NULL) in pqisrc_show_rcb_details()
1733 devp = rcb->dvp; in pqisrc_show_rcb_details()
1737 DBG_INFO("----- Start Dump: %s -----\n", msg); in pqisrc_show_rcb_details()
1738 pqisrc_print_buffer(softs, "host cdb", OS_GET_CDBP(rcb), rcb->cmdlen, PRINT_FLAG_HDR_COLUMN); in pqisrc_show_rcb_details()
1739 if (OS_GET_CDBP(rcb) != rcb->cdbp) in pqisrc_show_rcb_details()
1740 pqisrc_print_buffer(softs, "aio mapped cdb", rcb->cdbp, rcb->cmdlen, 0); in pqisrc_show_rcb_details()
1742 DBG_INFO("tag=0x%x dir=%u host_timeout=%ums\n", rcb->tag, in pqisrc_show_rcb_details()
1743 rcb->data_dir, (uint32_t)rcb->host_timeout_ms); in pqisrc_show_rcb_details()
1745 DBG_INFO("BTL: %d:%d:%d addr=0x%x\n", devp->bus, devp->target, in pqisrc_show_rcb_details()
1746 devp->lun, GET_LE32(devp->scsi3addr)); in pqisrc_show_rcb_details()
1748 if (rcb->path == AIO_PATH) in pqisrc_show_rcb_details()
1750 DBG_INFO("handle=0x%x\n", rcb->ioaccel_handle); in pqisrc_show_rcb_details()
1752 rcb->row_num, rcb->blocks_per_row, rcb->raid_map_index, rcb->raid_map_row); in pqisrc_show_rcb_details()
1765 DBG_INFO("----- Done -----\n\n"); in pqisrc_show_rcb_details()
1770 * Function used to build and send RAID bypass request to the adapter
1788 if (device->raid_map == NULL) { in pqisrc_build_scsi_cmd_raidbypass()
1790 rcb->tag, device->bus, device->target, device->lun); in pqisrc_build_scsi_cmd_raidbypass()
1799 if (l->is_write && !pqisrc_is_supported_write(softs, device)) in pqisrc_build_scsi_cmd_raidbypass()
1802 l->raid_map = device->raid_map; in pqisrc_build_scsi_cmd_raidbypass()
1803 l->block.last = l->block.first + l->block.cnt - 1; in pqisrc_build_scsi_cmd_raidbypass()
1804 l->raid_level = device->raid_level; in pqisrc_build_scsi_cmd_raidbypass()
1821 switch (device->raid_level) { in pqisrc_build_scsi_cmd_raidbypass()
1824 if (l->is_write) { in pqisrc_build_scsi_cmd_raidbypass()
1832 if (l->map.layout_map_count > 1 || l->is_write) { in pqisrc_build_scsi_cmd_raidbypass()
1848 if (l->map.idx >= RAID_MAP_MAX_ENTRIES) { in pqisrc_build_scsi_cmd_raidbypass()
1853 rcb->ioaccel_handle = in pqisrc_build_scsi_cmd_raidbypass()
1854 l->raid_map->dev_data[l->map.idx].ioaccel_handle; in pqisrc_build_scsi_cmd_raidbypass()
1863 rcb->encrypt_enable = false; in pqisrc_build_scsi_cmd_raidbypass()
1864 if (GET_LE16((uint8_t *)(&l->raid_map->flags)) & in pqisrc_build_scsi_cmd_raidbypass()
1866 pqisrc_set_enc_info(&rcb->enc_info, l->raid_map, in pqisrc_build_scsi_cmd_raidbypass()
1867 l->block.first); in pqisrc_build_scsi_cmd_raidbypass()
1868 rcb->encrypt_enable = true; in pqisrc_build_scsi_cmd_raidbypass()
1874 /* set the cdb ptr to the local bypass cdb */ in pqisrc_build_scsi_cmd_raidbypass()
1875 rcb->cdbp = &rcb->bypass_cdb[0]; in pqisrc_build_scsi_cmd_raidbypass()
1878 pqisrc_aio_build_cdb(l, disk_blk_cnt, rcb, rcb->cdbp); in pqisrc_build_scsi_cmd_raidbypass()
1905 tmf_req.header.iu_length = sizeof(tmf_req) - sizeof(iu_header_t); in pqisrc_send_aio_tmf()
1906 tmf_req.req_id = rcb->tag; in pqisrc_send_aio_tmf()
1907 tmf_req.error_idx = rcb->tag; in pqisrc_send_aio_tmf()
1908 tmf_req.nexus = devp->ioaccel_handle; in pqisrc_send_aio_tmf()
1909 /* memcpy(tmf_req.lun, devp->scsi3addr, sizeof(tmf_req.lun)); */ in pqisrc_send_aio_tmf()
1912 op_ib_q = &softs->op_aio_ib_q[0]; in pqisrc_send_aio_tmf()
1913 is_write = pqisrc_cdb_is_write(rcb->cdbp); in pqisrc_send_aio_tmf()
1915 uint64_t lun = rcb->cm_ccb->ccb_h.target_lun; in pqisrc_send_aio_tmf()
1916 if (lun && (rcb->dvp->is_multi_lun)) { in pqisrc_send_aio_tmf()
1924 tmf_req.req_id_to_manage = rcb_to_manage->tag; in pqisrc_send_aio_tmf()
1925 tmf_req.nexus = rcb_to_manage->ioaccel_handle; in pqisrc_send_aio_tmf()
1928 if (devp->raid_level == SA_RAID_1 || in pqisrc_send_aio_tmf()
1929 devp->raid_level == SA_RAID_5 || in pqisrc_send_aio_tmf()
1930 devp->raid_level == SA_RAID_6) { in pqisrc_send_aio_tmf()
1938 tmf_req.req_id, tmf_req.nexus, tmf_req.tmf, op_ib_q->q_id); in pqisrc_send_aio_tmf()
1940 rcb->path = AIO_PATH; in pqisrc_send_aio_tmf()
1941 rcb->req_pending = true; in pqisrc_send_aio_tmf()
1943 rcb->error_cmp_callback = pqisrc_process_aio_response_error; in pqisrc_send_aio_tmf()
1954 rcb->status = rval; in pqisrc_send_aio_tmf()
1957 if (rcb->status != PQI_STATUS_SUCCESS) { in pqisrc_send_aio_tmf()
1959 "stat:0x%x\n", tmf_type, rcb->status); in pqisrc_send_aio_tmf()
1981 tmf_req.header.iu_length = sizeof(tmf_req) - sizeof(iu_header_t); in pqisrc_send_raid_tmf()
1982 tmf_req.req_id = rcb->tag; in pqisrc_send_raid_tmf()
1984 memcpy(tmf_req.lun, devp->scsi3addr, sizeof(tmf_req.lun)); in pqisrc_send_raid_tmf()
1985 tmf_req.ml_device_lun_number = (uint8_t)rcb->cm_ccb->ccb_h.target_lun; in pqisrc_send_raid_tmf()
1992 tmf_req.obq_id_to_manage = rcb_to_manage->resp_qid; in pqisrc_send_raid_tmf()
1993 tmf_req.req_id_to_manage = rcb_to_manage->tag; in pqisrc_send_raid_tmf()
1996 if (softs->timeout_in_tmf && in pqisrc_send_raid_tmf()
1998 /* OS_TMF_TIMEOUT_SEC - 1 to accomodate driver processing */ in pqisrc_send_raid_tmf()
1999 tmf_req.timeout_in_sec = OS_TMF_TIMEOUT_SEC - 1; in pqisrc_send_raid_tmf()
2005 op_ib_q = &softs->op_raid_ib_q[0]; in pqisrc_send_raid_tmf()
2010 rcb->path = RAID_PATH; in pqisrc_send_raid_tmf()
2011 rcb->req_pending = true; in pqisrc_send_raid_tmf()
2013 rcb->error_cmp_callback = pqisrc_process_raid_response_error; in pqisrc_send_raid_tmf()
2024 rcb->status = rval; in pqisrc_send_raid_tmf()
2027 if (rcb->status != PQI_STATUS_SUCCESS) { in pqisrc_send_raid_tmf()
2029 "stat:0x%x\n", tmf_type, rcb->status); in pqisrc_send_raid_tmf()
2040 uint32_t qid = rcb->req_q ? rcb->req_q->q_id : -1; in dump_tmf_details()
2043 msg, rcb->req_pending, rcb->path, rcb->tag, in dump_tmf_details()
2044 rcb->tag, qid, (uint32_t)rcb->host_timeout_ms); in dump_tmf_details()
2056 softs->max_outstanding_io - softs->taglist.num_elem); in pqisrc_send_tmf()
2058 rcb->is_abort_cmd_from_host = true; in pqisrc_send_tmf()
2059 rcb->softs = softs; in pqisrc_send_tmf()
2061 /* No target rcb for general purpose TMFs like LUN RESET */ in pqisrc_send_tmf()
2064 rcb_to_manage->host_wants_to_abort_this = true; in pqisrc_send_tmf()
2071 if(!devp->is_physical_device) { in pqisrc_send_tmf()
2073 if(rcb_to_manage->path == AIO_PATH) { in pqisrc_send_tmf()
2074 if(devp->offload_enabled) in pqisrc_send_tmf()
2101 if (IS_AIO_PATH(rcb->dvp)) in get_counter_index()
2104 switch (rcb->dvp->raid_level) { in get_counter_index()
2117 ASSERT(rcb->path == RAID_PATH); in get_counter_index()
2125 /* return the counter type as ASCII-string */
2141 /* return the path as ASCII-string */
2153 /* return the io type as ASCII-string */
2193 ret_val = OS_ATOMIC64_INC(&pcounter->aio_read_cnt); in increment_this_counter()
2195 ret_val = OS_ATOMIC64_INC(&pcounter->aio_write_cnt); in increment_this_counter()
2197 ret_val = OS_ATOMIC64_INC(&pcounter->aio_non_read_write); in increment_this_counter()
2202 ret_val = OS_ATOMIC64_INC(&pcounter->raid_read_cnt); in increment_this_counter()
2204 ret_val = OS_ATOMIC64_INC(&pcounter->raid_write_cnt); in increment_this_counter()
2206 ret_val = OS_ATOMIC64_INC(&pcounter->raid_non_read_write); in increment_this_counter()
2216 io_type_t io_type = get_io_type_from_cdb(rcb->cdbp); in pqisrc_increment_io_counters()
2218 io_counters_t *pcounter = &softs->counters[type_index]; in pqisrc_increment_io_counters()
2221 ret_val = increment_this_counter(pcounter, rcb->path, io_type); in pqisrc_increment_io_counters()
2227 char *path = io_path_to_ascii(rcb->path); in pqisrc_increment_io_counters()
2236 /* @todo future: may want to make a per-dev counter */ in pqisrc_increment_io_counters()
2247 if (!softs->log_io_counters) in print_this_counter()
2273 /* Print the Non-Rw counts */ in print_this_counter()
2275 DBG_NOTE(" Non-RW: AIO=%8u(%3u%%) RAID=%8u\n", in print_this_counter()
2307 pcounter = &softs->counters[ii]; in print_all_counters()
2322 memset(softs->counters, 0, sizeof(softs->counters)); in print_all_counters()