diff --git a/debian/control b/debian/control index d72ecaad3..ccfd3f44f 100644 --- a/debian/control +++ b/debian/control @@ -35,7 +35,7 @@ Description: SCST development header and symbol files Package: scstadmin Architecture: any -Depends: ${misc:Depends}, lsb-base, perl +Depends: ${misc:Depends}, lsb-base, perl, psmisc Description: SCST admininstration tool scstadmin is a tool that uses the SCST sysfs interface to query and modify SCST settings. diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index 87730f576..0dc233f4b 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,7 +3,8 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -4.19.6 \ +4.20 \ +4.19.13-nc \ 4.18.18-nc \ 4.17.18-nc \ 4.16.18-nc \ diff --git a/qla2x00t/qla_iocb.c b/qla2x00t/qla_iocb.c index 37e0bdbd9..fe327ea4f 100644 --- a/qla2x00t/qla_iocb.c +++ b/qla2x00t/qla_iocb.c @@ -1875,7 +1875,7 @@ static void qla25xx_set_que(srb_t *sp, struct rsp_que **rsp) { struct scsi_cmnd *cmd = GET_CMD_SP(sp); struct qla_hw_data *ha = sp->fcport->vha->hw; - int affinity = cmd->request->cpu; + int affinity = scst_blk_rq_cpu(cmd->request); if (ha->flags.cpu_affinity_enabled && affinity >= 0 && affinity < ha->max_rsp_queues - 1) diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index a565b8719..f9ebba662 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -304,7 +304,9 @@ struct scsi_host_template qla2xxx_driver_template = { #endif .this_id = -1, .cmd_per_lun = 3, +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) .use_clustering = ENABLE_CLUSTERING, +#endif .sg_tablesize = SG_ALL, .max_sectors = 0xFFFF, @@ -1160,7 +1162,8 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type, goto eh_reset_failed; } err = 2; - if (do_reset(fcport, cmd->device->lun, cmd->request->cpu + 1) + if (do_reset(fcport, cmd->device->lun, + scst_blk_rq_cpu(cmd->request) + 1) != QLA_SUCCESS) { ql_log(ql_log_warn, vha, 0x800c, "do_reset failed for cmd=%p.\n", cmd); diff --git a/scst/include/backport.h b/scst/include/backport.h index 30e84d855..1b3cb7632 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -22,6 +22,9 @@ #include #include /* struct request_queue */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 21, 0) +#include +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #include /* struct bsg_job */ #endif @@ -115,6 +118,17 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q) } #endif +/* */ + +static inline unsigned int scst_blk_rq_cpu(struct request *rq) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) + return rq->cpu; +#else + return blk_mq_rq_cpu(rq); +#endif +} + /* */ /* diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 7fe5bbc86..9d1a8c08d 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -5368,10 +5368,16 @@ static int scst_alloc_add_tgt_dev(struct scst_session *sess, scst_sgv_pool_use_norm(tgt_dev); if (dev->scsi_dev != NULL) { - ini_sg = dev->scsi_dev->host->sg_tablesize; - ini_unchecked_isa_dma = dev->scsi_dev->host->unchecked_isa_dma; - ini_use_clustering = (dev->scsi_dev->host->use_clustering == - ENABLE_CLUSTERING); + struct Scsi_Host *shost = dev->scsi_dev->host; + + ini_sg = shost->sg_tablesize; + ini_unchecked_isa_dma = shost->unchecked_isa_dma; +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) + ini_use_clustering = shost->use_clustering == ENABLE_CLUSTERING; +#else + ini_use_clustering = !(shost->dma_boundary == PAGE_SIZE - 1 && + shost->max_segment_size == PAGE_SIZE); +#endif } else { ini_sg = (1 << 15) /* infinite */; ini_unchecked_isa_dma = 0; @@ -8515,7 +8521,7 @@ static void scsi_end_async(struct request *req, blk_status_t error) #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) lockdep_assert_held(req->q->queue_lock); -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) if (!req->q->mq_ops) lockdep_assert_held(req->q->queue_lock); #endif @@ -8550,7 +8556,12 @@ static void scsi_end_async(struct request *req, blk_status_t error) kmem_cache_free(scsi_io_context_cache, sioc); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) + /* See also commit 92bc5a24844a ("block: remove __blk_put_request()") */ __blk_put_request(req->q, req); +#else + blk_put_request(req); +#endif return; } diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 5ce4c1a53..3dada2d20 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1663,7 +1663,12 @@ static struct scsi_host_template scst_lcl_ini_driver_template = { .sg_tablesize = 0xFFFF, .max_sectors = 0xffff, /* Possible pass-through backend device may not support clustering */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) .use_clustering = DISABLE_CLUSTERING, +#else + .dma_boundary = PAGE_SIZE - 1, + .max_segment_size = PAGE_SIZE, +#endif .skip_settle_delay = 1, .module = THIS_MODULE, }; diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index c797bb728..a93512712 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1074,14 +1074,25 @@ out: */ static int srpt_zerolength_write(struct srpt_rdma_ch *ch) { +#ifdef USE_PRE_440_WR_STRUCTURE struct ib_send_wr wr; +#else + struct ib_rdma_wr wr; +#endif BAD_WR_MODIFIER struct ib_send_wr *bad_wr; memset(&wr, 0, sizeof(wr)); +#ifdef USE_PRE_440_WR_STRUCTURE wr.opcode = IB_WR_RDMA_WRITE; wr.wr_id = encode_wr_id(SRPT_RDMA_ZEROLENGTH_WRITE, 0xffffffffUL); wr.send_flags = IB_SEND_SIGNALED; return ib_post_send(ch->qp, &wr, &bad_wr); +#else + wr.wr.opcode = IB_WR_RDMA_WRITE; + wr.wr.wr_id = encode_wr_id(SRPT_RDMA_ZEROLENGTH_WRITE, 0xffffffffUL); + wr.wr.send_flags = IB_SEND_SIGNALED; + return ib_post_send(ch->qp, &wr.wr, &bad_wr); +#endif } /**