Lines Matching refs:io_hdr

659 	msg.hdr.original_sc = io->io_hdr.remote_io;
661 msg.hdr.nexus = io->io_hdr.nexus;
662 msg.hdr.status = io->io_hdr.status;
663 msg.dt.flags = io->io_hdr.flags;
676 if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) {
684 KASSERT((io->io_hdr.flags & CTL_FLAG_BUS_ADDR) == 0,
716 if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) {
724 KASSERT((io->io_hdr.flags &
739 io->io_hdr.port_status = 31341;
753 if (io->io_hdr.flags & CTL_FLAG_FAILOVER) {
756 io->io_hdr.port_status = 31342;
760 io->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE;
761 io->io_hdr.flags |= CTL_FLAG_DMA_INPROG;
771 if (io->io_hdr.io_type == CTL_IO_SCSI) {
774 msg.hdr.original_sc = io->io_hdr.remote_io;
775 msg.hdr.nexus = io->io_hdr.nexus;
776 msg.hdr.status = io->io_hdr.status;
803 ctsio->io_hdr.flags |= CTL_FLAG_IO_ACTIVE;
804 ctsio->io_hdr.msg_type = CTL_MSG_FINISH_IO;
805 ctsio->io_hdr.status = msg_info->hdr.status;
826 ctsio->io_hdr.msg_type = CTL_MSG_FINISH_IO;
1080 io->io_hdr.msg_type = CTL_MSG_FAILOVER;
1081 io->io_hdr.nexus.targ_mapped_lun = lun->lun;
1445 io->io_hdr.io_type = CTL_IO_SCSI;
1446 io->io_hdr.msg_type = CTL_MSG_SERIALIZE;
1447 io->io_hdr.remote_io = msg->hdr.original_sc;
1448 io->io_hdr.flags |= CTL_FLAG_FROM_OTHER_SC |
1458 io->io_hdr.flags |= CTL_FLAG_INT_COPY;
1459 io->io_hdr.nexus = msg->hdr.nexus;
1464 io->io_hdr.start_time = time_uptime;
1465 getbinuptime(&io->io_hdr.start_bt);
1474 io->io_hdr.flags &= ~CTL_FLAG_DATA_MASK;
1475 io->io_hdr.flags |=
1492 io->io_hdr.msg_type = CTL_MSG_DATAMOVE;
1493 io->io_hdr.flags |= CTL_FLAG_IO_ACTIVE;
1498 io->io_hdr.remote_io = msg->hdr.serializing_sc;
1500 io->io_hdr.status = msg->hdr.status;
1504 getbinuptime(&io->io_hdr.dma_start_bt);
1528 io->io_hdr.flags &= ~CTL_FLAG_BUS_ADDR;
1529 io->io_hdr.flags |= msg->dt.flags &
1565 io->io_hdr.msg_type = CTL_MSG_DATAMOVE_DONE;
1566 io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG;
1567 io->io_hdr.flags |= CTL_FLAG_IO_ACTIVE;
1568 io->io_hdr.port_status = msg->scsi.port_status;
1571 io->io_hdr.status = msg->hdr.status;
1578 io->io_hdr.flags |= CTL_FLAG_STATUS_SENT;
1592 io->io_hdr.flags |= CTL_FLAG_IO_ACTIVE;
1593 io->io_hdr.msg_type = CTL_MSG_R2R;
1594 io->io_hdr.remote_io = msg->hdr.serializing_sc;
1625 io->io_hdr.flags &= ~CTL_FLAG_SENT_2OTHER_SC;
1626 io->io_hdr.flags |= CTL_FLAG_IO_ACTIVE;
1629 io->io_hdr.msg_type = CTL_MSG_BAD_JUJU;
1639 taskio->io_hdr.io_type = CTL_IO_TASK;
1640 taskio->io_hdr.flags |= CTL_FLAG_FROM_OTHER_SC;
1641 taskio->io_hdr.nexus = msg->hdr.nexus;
1646 taskio->io_hdr.start_time = time_uptime;
1647 getbinuptime(&taskio->io_hdr.start_bt);
1657 presio->io_hdr.msg_type = CTL_MSG_PERS_ACTION;
1658 presio->io_hdr.flags |= CTL_FLAG_FROM_OTHER_SC;
1659 presio->io_hdr.nexus = msg->hdr.nexus;
1717 dest->io_hdr.status = src->hdr.status;
1728 dest->hdr.status = src->io_hdr.status;
2279 targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun;
2334 LIST_INSERT_HEAD(&lun->ooa_queue, &ctsio->io_hdr, ooa_links);
2336 bio = (union ctl_io *)LIST_NEXT(&ctsio->io_hdr, ooa_links);
2341 ctsio->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR;
2345 ctsio->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE;
2349 msg_info.hdr.original_sc = ctsio->io_hdr.remote_io;
2357 ctsio->io_hdr.blocker = bio;
2358 TAILQ_INSERT_TAIL(&bio->io_hdr.blocked_queue, &ctsio->io_hdr,
2363 LIST_REMOVE(&ctsio->io_hdr, ooa_links);
2368 LIST_REMOVE(&ctsio->io_hdr, ooa_links);
2373 msg_info.hdr.original_sc = ctsio->io_hdr.remote_io;
2420 entry->start_bt = io->io_hdr.start_bt;
2424 if (io->io_hdr.blocker != NULL)
2427 if (io->io_hdr.flags & CTL_FLAG_DMA_INPROG)
2430 if (io->io_hdr.flags & CTL_FLAG_ABORT)
2433 if (io->io_hdr.flags & CTL_FLAG_IS_WAS_ON_RTR)
2436 if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED)
2439 if (io->io_hdr.flags & CTL_FLAG_STATUS_QUEUED)
2442 if (io->io_hdr.flags & CTL_FLAG_STATUS_SENT)
3893 io->io_hdr.pool = pool_ref;
3895 TAILQ_INIT(&io->io_hdr.blocked_queue);
3908 io->io_hdr.pool = pool_ref;
3910 TAILQ_INIT(&io->io_hdr.blocked_queue);
3923 pool = (struct ctl_io_pool *)io->io_hdr.pool;
3938 pool = io->io_hdr.pool;
3940 io->io_hdr.pool = pool;
3942 TAILQ_INIT(&io->io_hdr.blocked_queue);
5032 KASSERT(io->io_hdr.io_type == CTL_IO_SCSI,
5033 ("%s: unexpected I/O type %x", __func__, io->io_hdr.io_type));
5037 if (((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) ||
5038 ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE &&
5039 (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) ||
5040 ((io->io_hdr.flags & CTL_FLAG_ABORT) != 0)) {
5046 if (io->io_hdr.flags & CTL_FLAG_ALLOCATED)
5088 if ((io->io_hdr.flags & CTL_FLAG_IO_CONT) &&
5089 (io->io_hdr.flags & CTL_FLAG_ABORT) == 0 &&
5090 ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE ||
5091 (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) {
5115 if ((io->io_hdr.flags & CTL_FLAG_IO_CONT) &&
5116 (io->io_hdr.flags & CTL_FLAG_ABORT) == 0 &&
5117 ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE ||
5118 (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) {
5127 if (io->io_hdr.flags & CTL_FLAG_ALLOCATED)
5144 if ((io->io_hdr.flags & CTL_FLAG_ABORT) != 0 ||
5145 ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE &&
5146 (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) {
5147 if (io->io_hdr.flags & CTL_FLAG_ALLOCATED)
5162 if (io->io_hdr.flags & CTL_FLAG_IO_CONT) {
5181 residx = ctl_get_initindex(&ctsio->io_hdr.nexus);
5218 residx = ctl_get_initindex(&ctsio->io_hdr.nexus);
5266 residx = ctl_get_initindex(&ctsio->io_hdr.nexus);
5321 initidx = ctl_get_initindex(&ctsio->io_hdr.nexus);
5396 lbalen = (struct ctl_lba_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
5424 if (((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0)
5431 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
5479 if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) {
5481 ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED;
5591 if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) {
5601 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
5622 ctsio->io_hdr.status = CTL_STATUS_NONE;
5624 &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
5627 ctsio->io_hdr.flags &= ~CTL_FLAG_IO_CONT;
5720 ctsio->io_hdr.flags |= CTL_FLAG_IO_CONT;
5734 (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) {
5740 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
5747 lbalen = (struct ctl_lba_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
5779 if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) {
5785 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
5837 &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
5848 if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) {
5850 ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED;
5865 initidx = ctl_get_initindex(&ctsio->io_hdr.nexus);
5881 ctl_get_initindex(&ctsio->io_hdr.nexus),
5970 ctsio->io_hdr.ctl_private[CTL_PRIV_MODEPAGE].bytes;
6182 initidx = ctl_get_initindex(&ctsio->io_hdr.nexus);
6261 if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) {
6267 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
6306 ctsio->io_hdr.flags |= CTL_FLAG_IO_CONT;
6310 ctsio->io_hdr.ctl_private[CTL_PRIV_MODEPAGE].bytes;
6647 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
6900 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
6954 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
7004 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
7049 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
7052 lbalen = (struct ctl_lba_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
7109 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
7191 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
7360 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
7528 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
7567 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
7607 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
7843 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
7911 persis_io.hdr.nexus = ctsio->io_hdr.nexus;
7981 persis_io.hdr.nexus = ctsio->io_hdr.nexus;
8058 persis_io.hdr.nexus = ctsio->io_hdr.nexus;
8095 persis_io.hdr.nexus = ctsio->io_hdr.nexus;
8231 if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) {
8237 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
8246 residx = ctl_get_initindex(&ctsio->io_hdr.nexus);
8374 persis_io.hdr.nexus = ctsio->io_hdr.nexus;
8392 persis_io.hdr.nexus = ctsio->io_hdr.nexus;
8440 persis_io.hdr.nexus = ctsio->io_hdr.nexus;
8498 persis_io.hdr.nexus = ctsio->io_hdr.nexus;
8523 persis_io.hdr.nexus = ctsio->io_hdr.nexus;
8856 &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
8879 ctsio->io_hdr.status = CTL_STATUS_NONE;
8880 ctsio->io_hdr.flags &= ~CTL_FLAG_IO_CONT;
8882 &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
8963 ctsio->io_hdr.flags |= CTL_FLAG_IO_CONT;
8967 &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
9062 &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
9152 initidx = ctl_get_initindex(&ctsio->io_hdr.nexus);
9217 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
9279 initidx = ctl_get_initindex(&ctsio->io_hdr.nexus);
9349 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
9426 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
9474 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
9541 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
9580 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
9668 scsi_ulto2b(ctsio->io_hdr.nexus.targ_port, &desc->identifier[2]);
9683 g = 2 + ctsio->io_hdr.nexus.targ_port / softc->port_cnt;
9696 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
9788 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
9840 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
9916 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
9964 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
10013 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
10279 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
10513 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
10548 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
10579 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
10655 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
10668 KASSERT(io->io_hdr.io_type == CTL_IO_SCSI,
10669 ("%s: unexpected I/O type %x", __func__, io->io_hdr.io_type));
10849 KASSERT(io->io_hdr.io_type == CTL_IO_SCSI,
10850 ("%s: unexpected I/O type %x", __func__, io->io_hdr.io_type));
10858 &io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
10859 if ((io->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0 ||
10892 if (seq && (io1->io_hdr.flags & CTL_FLAG_SERSEQ_DONE))
10904 if (io1->io_hdr.flags & CTL_FLAG_SERSEQ_DONE)
10927 && ((pending_io->io_hdr.nexus.targ_port ==
10928 ooa_io->io_hdr.nexus.targ_port)
10929 && (pending_io->io_hdr.nexus.initid ==
10930 ooa_io->io_hdr.nexus.initid))
10931 && ((ooa_io->io_hdr.flags & (CTL_FLAG_ABORT |
10949 && ((pending_io->io_hdr.nexus.targ_port ==
10950 ooa_io->io_hdr.nexus.targ_port)
10951 && (pending_io->io_hdr.nexus.initid ==
10952 ooa_io->io_hdr.nexus.initid))
10953 && ((ooa_io->io_hdr.flags & (CTL_FLAG_ABORT |
11035 if (__predict_false(pending_io->io_hdr.flags & CTL_FLAG_ABORT))
11056 ooa_io = (union ctl_io *)LIST_NEXT(&ooa_io->io_hdr, ooa_links)) {
11087 if (io->io_hdr.blocker == NULL)
11090 obio = bio = io->io_hdr.blocker;
11092 bio = (union ctl_io *)LIST_NEXT(&bio->io_hdr, ooa_links);
11097 TAILQ_REMOVE(&obio->io_hdr.blocked_queue,
11098 &io->io_hdr, blocked_links);
11099 TAILQ_INSERT_TAIL(&bio->io_hdr.blocked_queue,
11100 &io->io_hdr, blocked_links);
11101 io->io_hdr.blocker = bio;
11107 TAILQ_REMOVE(&obio->io_hdr.blocked_queue, &io->io_hdr, blocked_links);
11108 io->io_hdr.blocker = NULL;
11115 if ((io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) &&
11117 io->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE;
11118 msg_info.hdr.original_sc = io->io_hdr.remote_io;
11137 io->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR;
11150 if ((io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) &&
11153 LIST_REMOVE(&io->io_hdr, ooa_links);
11156 msg_info.hdr.original_sc = io->io_hdr.remote_io;
11185 for (io = (union ctl_io *)TAILQ_FIRST(&bio->io_hdr.blocked_queue);
11187 next_io = (union ctl_io *)TAILQ_NEXT(&io->io_hdr, blocked_links);
11189 KASSERT(io->io_hdr.blocker != NULL,
11193 KASSERT(!skip || TAILQ_EMPTY(&bio->io_hdr.blocked_queue),
11270 residx = ctl_get_initindex(&ctsio->io_hdr.nexus);
11337 targ_lun = rio->io_hdr.nexus.targ_mapped_lun;
11388 TAILQ_REMOVE(&io->blocker->io_hdr.blocked_queue,
11421 targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun;
11448 LIST_INSERT_HEAD(&lun->ooa_queue, &ctsio->io_hdr, ooa_links);
11459 ctsio->io_hdr.flags &= ~CTL_FLAG_DATA_MASK;
11460 ctsio->io_hdr.flags |= entry->flags & CTL_FLAG_DATA_MASK;
11471 ctsio->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR;
11493 initidx = ctl_get_initindex(&ctsio->io_hdr.nexus);
11540 ctsio->io_hdr.status = CTL_SCSI_ERROR | CTL_AUTOSENSE;
11568 ctsio->io_hdr.flags |= CTL_FLAG_SENT_2OTHER_SC;
11569 ctsio->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE;
11575 msg_info.hdr.nexus = ctsio->io_hdr.nexus;
11592 bio = (union ctl_io *)LIST_NEXT(&ctsio->io_hdr, ooa_links);
11596 ctsio->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR;
11601 ctsio->io_hdr.blocker = bio;
11602 TAILQ_INSERT_TAIL(&bio->io_hdr.blocked_queue, &ctsio->io_hdr,
11718 if (ctsio->io_hdr.flags & CTL_FLAG_ABORT) {
11742 if (!(io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC)) {
11745 msg_info.hdr.nexus = io->io_hdr.nexus;
11754 initidx = ctl_get_initindex(&io->io_hdr.nexus);
11835 targ_lun = io->io_hdr.nexus.targ_mapped_lun;
11836 initidx = ctl_get_initindex(&io->io_hdr.nexus);
11848 if ((io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) == 0) {
11852 msg_info.hdr.nexus = io->io_hdr.nexus;
11915 targ_lun = io->io_hdr.nexus.targ_mapped_lun;
11927 ctl_abort_tasks_lun(lun, io->io_hdr.nexus.targ_port,
11928 io->io_hdr.nexus.initid,
11929 (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0);
11932 (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0);
11981 if (!(io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC)) {
11984 msg_info.hdr.nexus = io->io_hdr.nexus;
11993 initidx = ctl_get_initindex(&io->io_hdr.nexus);
12010 targ_lun = io->io_hdr.nexus.targ_mapped_lun;
12030 if ((xioh->nexus.targ_port != io->io_hdr.nexus.targ_port)
12031 || (xioh->nexus.initid != io->io_hdr.nexus.initid)
12058 if ((io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) == 0 &&
12062 msg_info.hdr.nexus = io->io_hdr.nexus;
12089 targ_lun = io->io_hdr.nexus.targ_mapped_lun;
12101 if ((xioh->nexus.targ_port != io->io_hdr.nexus.targ_port)
12102 || (xioh->nexus.initid != io->io_hdr.nexus.initid)
12127 targ_lun = io->io_hdr.nexus.targ_mapped_lun;
12137 initidx = ctl_get_initindex(&io->io_hdr.nexus);
12153 KASSERT(io->io_hdr.io_type == CTL_IO_TASK,
12154 ("ctl_run_task: Unextected io_type %d\n", io->io_hdr.io_type));
12196 io->io_hdr.status = CTL_SUCCESS;
12198 io->io_hdr.status = CTL_ERROR;
12214 targ_lun = io->io_hdr.nexus.targ_mapped_lun;
12215 switch (io->io_hdr.msg_type) {
12232 io->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR;
12248 LIST_REMOVE(&io->io_hdr, ooa_links);
12271 __func__, io->io_hdr.msg_type);
12367 (io->io_hdr.flags & CTL_FLAG_DATA_MASK) !=
12386 io->io_hdr.status = CTL_SCSI_ERROR | CTL_AUTOSENSE;
12429 KASSERT(io->io_hdr.io_type == CTL_IO_SCSI,
12430 ("%s: unexpected I/O type %x", __func__, io->io_hdr.io_type));
12434 bintime_sub(&cur_bt, &io->io_hdr.dma_start_bt);
12435 bintime_add(&io->io_hdr.dma_bt, &cur_bt);
12437 io->io_hdr.num_dmas++;
12439 if ((io->io_hdr.port_status != 0) &&
12440 ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE ||
12441 (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) {
12443 /*retry_count*/ io->io_hdr.port_status);
12445 (io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT &&
12446 ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE ||
12447 (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) {
12474 getbinuptime(&io->io_hdr.dma_start_bt);
12478 if (io->io_hdr.flags & CTL_FLAG_DELAY_DONE) {
12479 io->io_hdr.flags &= ~CTL_FLAG_DELAY_DONE;
12486 callout_init(&io->io_hdr.delay_callout, /*mpsafe*/ 1);
12487 io->io_hdr.flags |= CTL_FLAG_DELAY_DONE;
12488 callout_reset(&io->io_hdr.delay_callout,
12503 if (io->io_hdr.flags & CTL_FLAG_ABORT) {
12505 io->scsiio.tag_num, io->io_hdr.nexus.initid,
12506 io->io_hdr.nexus.targ_port,
12507 io->io_hdr.nexus.targ_lun);
12508 io->io_hdr.port_status = 31337;
12536 msg.hdr.serializing_sc = io->io_hdr.remote_io;
12537 msg.hdr.nexus = io->io_hdr.nexus;
12538 msg.hdr.status = io->io_hdr.status;
12546 msg.scsi.port_status = io->io_hdr.port_status;
12547 io->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE;
12548 if (io->io_hdr.flags & CTL_FLAG_FAILOVER) {
12558 bintime_sub(&cur_bt, &io->io_hdr.dma_start_bt);
12559 bintime_add(&io->io_hdr.dma_bt, &cur_bt);
12561 io->io_hdr.num_dmas++;
12746 && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE &&
12747 (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS))
12750 if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE &&
12751 (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) {
12805 if ((io->io_hdr.flags & CTL_FLAG_BUS_ADDR) == 0) {
12811 KASSERT((io->io_hdr.flags & CTL_FLAG_BUS_ADDR) == 0,
12894 if (io->io_hdr.flags & CTL_FLAG_FAILOVER) {
12905 if (io->io_hdr.flags & CTL_FLAG_ABORT) {
12907 io->scsiio.tag_num, io->io_hdr.nexus.initid,
12908 io->io_hdr.nexus.targ_port,
12909 io->io_hdr.nexus.targ_lun);
12910 io->io_hdr.port_status = 31338;
12915 if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT)
12917 else if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN)
12920 io->io_hdr.port_status = 31339;
12938 if ((time_uptime - io->io_hdr.start_time) > ctl_time_io_secs) {
12947 switch (io->io_hdr.io_type) {
12963 __func__, io->io_hdr.io_type);
12967 (intmax_t)time_uptime - io->io_hdr.start_time);
12973 switch (io->io_hdr.io_type) {
12983 __func__, io->io_hdr.io_type);
12988 io->io_hdr.nexus.targ_mapped_lun));
13000 io->io_hdr.status == CTL_SUCCESS &&
13001 (io->io_hdr.flags & CTL_FLAG_STATUS_SENT) == 0) {
13027 ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) &&
13028 ((io->io_hdr.flags & CTL_FLAG_STATUS_SENT) == 0))
13037 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS &&
13038 io->io_hdr.io_type == CTL_IO_SCSI) {
13044 bintime_sub(&bt, &io->io_hdr.start_bt);
13046 if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) ==
13049 else if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) ==
13057 lun->stats.dmas[type] += io->io_hdr.num_dmas;
13059 bintime_add(&lun->stats.dma_time[type], &io->io_hdr.dma_bt);
13066 port->stats.dmas[type] += io->io_hdr.num_dmas;
13068 bintime_add(&port->stats.dma_time[type], &io->io_hdr.dma_bt);
13084 LIST_REMOVE(&io->io_hdr, ooa_links);
13108 if (io->io_hdr.flags & CTL_FLAG_ABORT)
13114 if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS &&
13124 (io->io_hdr.flags & CTL_FLAG_SENT_2OTHER_SC)) {
13127 msg.hdr.serializing_sc = io->io_hdr.remote_io;
13128 msg.hdr.nexus = io->io_hdr.nexus;
13152 targ_lun = ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun);
13171 initidx = ctl_get_initindex(&io->io_hdr.nexus);
13201 io->io_hdr.start_time = time_uptime;
13202 getbinuptime(&io->io_hdr.start_bt);
13206 io->io_hdr.nexus.targ_mapped_lun =
13207 ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun);
13209 switch (io->io_hdr.io_type) {
13217 printf("ctl_queue: unknown I/O type %d\n", io->io_hdr.io_type);
13232 io->io_hdr.start_time = time_uptime;
13233 getbinuptime(&io->io_hdr.start_bt);
13237 io->io_hdr.nexus.targ_mapped_lun =
13238 ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun);
13240 switch (io->io_hdr.io_type) {
13252 printf("ctl_run: unknown I/O type %d\n", io->io_hdr.io_type);
13276 if (!TAILQ_EMPTY(&io->io_hdr.blocked_queue)) {
13278 io->io_hdr.flags |= CTL_FLAG_SERSEQ_DONE;
13282 io->io_hdr.flags |= CTL_FLAG_SERSEQ_DONE;
13293 if (io->io_hdr.flags & CTL_FLAG_ALREADY_DONE) {
13298 io->io_hdr.io_type,
13299 io->io_hdr.msg_type,
13301 io->io_hdr.nexus.initid,
13302 io->io_hdr.nexus.targ_port,
13303 io->io_hdr.nexus.targ_lun,
13304 (io->io_hdr.io_type ==
13308 io->io_hdr.flags,
13309 io->io_hdr.status);
13311 io->io_hdr.flags |= CTL_FLAG_ALREADY_DONE;
13318 if (io->io_hdr.flags & CTL_FLAG_INT_COPY)
13322 if (io->io_hdr.flags & CTL_FLAG_DELAY_DONE) {
13323 io->io_hdr.flags &= ~CTL_FLAG_DELAY_DONE;
13329 callout_init(&io->io_hdr.delay_callout, /*mpsafe*/ 1);
13330 io->io_hdr.flags |= CTL_FLAG_DELAY_DONE;
13331 callout_reset(&io->io_hdr.delay_callout,
13388 if (io->io_hdr.io_type == CTL_IO_TASK)
13525 idx = (io->io_hdr.nexus.targ_port * 127 +
13526 io->io_hdr.nexus.initid) % worker_threads;
13529 STAILQ_INSERT_TAIL(&thr->incoming_queue, &io->io_hdr, links);
13540 thr = &softc->threads[io->io_hdr.nexus.targ_mapped_lun % worker_threads];
13542 STAILQ_INSERT_TAIL(&thr->rtr_queue, &io->io_hdr, links);
13553 thr = &softc->threads[io->io_hdr.nexus.targ_mapped_lun % worker_threads];
13555 STAILQ_INSERT_TAIL(&thr->done_queue, &io->io_hdr, links);
13566 thr = &softc->threads[io->io_hdr.nexus.targ_mapped_lun % worker_threads];
13568 STAILQ_INSERT_TAIL(&thr->isc_queue, &io->io_hdr, links);