Re: [PATCH] lpfc: Fix possible NULL pointer dereference
On Thu, Jul 28, 2016 at 09:21:47PM -0400, Martin K . Petersen wrote: > > "James" == James Smart writes: > > James> This patch is good. > > Johannes: You were going to tweak a few things and resubmit. Please do. Oh yes, sorry totally forgot about this one. My bad. -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] nvme-fabrics: rework nvmf_get_address() for variable options
On Thu, Jul 28, 2016 at 05:00:25PM -0700, James Smart wrote: > > Revise nvmf_get_address() string to account for not all options being > present. > > Signed-off-by: James Smart Acked-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] nvme-fabrics: revise host transport option descriptions
On Thu, Jul 28, 2016 at 05:00:26PM -0700, James Smart wrote: > > Revise some of the comments so not so ethernet-network centric > > Signed-off-by: James Smart Acked-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] nvme-fabrics: Add host_traddr options field to host infrastructure
On Thu, Jul 28, 2016 at 05:00:27PM -0700, James Smart wrote: > > Add the host_traddr field to allow specification of the host-port > connection info for the transport. Will be used by FC transport. > > Signed-off-by: James Smart Acked-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] ipr: Add asynchronous error notification
This patch implements functions for pushing HCAM (host controlled asynchronous messages) error buffers to userspace through sysfs attributes. Reads to the "async_err_log" attribute will result in a single HCAM buffer being copied to userspace; one can process the next HCAM buffer by writing any string to the same attribute. A new list was added to the ioa_cfg structure to store the HCAM buffers for later reporting. We also send a KOBJ_CHANGE event whenever a new HCAM buffer is made available to userspace. Signed-off-by: Heitor Ricardo Alves de Siqueira Signed-off-by: Gabriel Krisman Bertazi --- drivers/scsi/ipr.c | 123 +++-- drivers/scsi/ipr.h | 7 ++- 2 files changed, 116 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index d6803a9e5ab8..ce713aa14960 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -1472,7 +1472,7 @@ static void ipr_process_ccn(struct ipr_cmnd *ipr_cmd) struct ipr_hostrcb *hostrcb = ipr_cmd->u.hostrcb; u32 ioasc = be32_to_cpu(ipr_cmd->s.ioasa.hdr.ioasc); - list_del(&hostrcb->queue); + list_del_init(&hostrcb->queue); list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); if (ioasc) { @@ -2551,6 +2551,23 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg, } } +static struct ipr_hostrcb *ipr_get_free_hostrcb(struct ipr_ioa_cfg *ioa) +{ + struct ipr_hostrcb *hostrcb; + + hostrcb = list_first_entry_or_null(&ioa->hostrcb_free_q, + struct ipr_hostrcb, queue); + + if (unlikely(!hostrcb)) { + dev_info(&ioa->pdev->dev, "Reclaiming async error buffers."); + hostrcb = list_first_entry_or_null(&ioa->hostrcb_report_q, + struct ipr_hostrcb, queue); + } + + list_del_init(&hostrcb->queue); + return hostrcb; +} + /** * ipr_process_error - Op done function for an adapter error log. * @ipr_cmd: ipr command struct @@ -2568,13 +2585,14 @@ static void ipr_process_error(struct ipr_cmnd *ipr_cmd) struct ipr_hostrcb *hostrcb = ipr_cmd->u.hostrcb; u32 ioasc = be32_to_cpu(ipr_cmd->s.ioasa.hdr.ioasc); u32 fd_ioasc; + char *envp[] = { "ASYNC_ERR_LOG=1", NULL}; if (ioa_cfg->sis64) fd_ioasc = be32_to_cpu(hostrcb->hcam.u.error64.fd_ioasc); else fd_ioasc = be32_to_cpu(hostrcb->hcam.u.error.fd_ioasc); - list_del(&hostrcb->queue); + list_del_init(&hostrcb->queue); list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); if (!ioasc) { @@ -2587,6 +2605,10 @@ static void ipr_process_error(struct ipr_cmnd *ipr_cmd) "Host RCB failed with IOASC: 0x%08X\n", ioasc); } + list_add_tail(&hostrcb->queue, &ioa_cfg->hostrcb_report_q); + hostrcb = ipr_get_free_hostrcb(ioa_cfg); + kobject_uevent_env(&ioa_cfg->host->shost_dev.kobj, KOBJ_CHANGE, envp); + ipr_send_hcam(ioa_cfg, IPR_HCAM_CDB_OP_CODE_LOG_DATA, hostrcb); } @@ -4089,6 +4111,64 @@ static struct device_attribute ipr_ioa_fw_type_attr = { .show = ipr_show_fw_type }; +static ssize_t ipr_read_async_err_log(struct file *filep, struct kobject *kobj, + struct bin_attribute *bin_attr, char *buf, + loff_t off, size_t count) +{ + struct device *cdev = container_of(kobj, struct device, kobj); + struct Scsi_Host *shost = class_to_shost(cdev); + struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata; + struct ipr_hostrcb *hostrcb; + unsigned long lock_flags = 0; + int ret; + + spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); + hostrcb = list_first_entry_or_null(&ioa_cfg->hostrcb_report_q, + struct ipr_hostrcb, queue); + if (!hostrcb) { + spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); + return 0; + } + ret = memory_read_from_buffer(buf, count, &off, &hostrcb->hcam, + sizeof(hostrcb->hcam)); + spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); + return ret; +} + +static ssize_t ipr_next_async_err_log(struct file *filep, struct kobject *kobj, + struct bin_attribute *bin_attr, char *buf, + loff_t off, size_t count) +{ + struct device *cdev = container_of(kobj, struct device, kobj); + struct Scsi_Host *shost = class_to_shost(cdev); + struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata; + struct ipr_hostrcb *hostrcb; + unsigned long lock_flags = 0; + + spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); + hostrcb = list_first_entry_or_null(&ioa_cfg->hostrcb_report_q, +
[PATCH v2] lpfc: Fix possible NULL pointer dereference
Check for the existence of piocb->vport before accessing it. Signed-off-by: Johannes Thumshirn --- Changes to v1: * Fix spelling of piocb (Tyrel) * re-introduce the BU() assertion if piocb->vport is NULL (Tyrel) drivers/scsi/lpfc/lpfc_sli.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 70edf21..3d04ef1 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -1323,21 +1323,18 @@ lpfc_sli_ringtxcmpl_put(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, { lockdep_assert_held(&phba->hbalock); + BUG_ON(!piocb || !piocb->vport); + list_add_tail(&piocb->list, &pring->txcmplq); piocb->iocb_flag |= LPFC_IO_ON_TXCMPLQ; if ((unlikely(pring->ringno == LPFC_ELS_RING)) && (piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) && (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) && -(!(piocb->vport->load_flag & FC_UNLOADING))) { - if (!piocb->vport) - BUG(); - else - mod_timer(&piocb->vport->els_tmofunc, - jiffies + - msecs_to_jiffies(1000 * (phba->fc_ratov << 1))); - } - + (!(piocb->vport->load_flag & FC_UNLOADING))) + mod_timer(&piocb->vport->els_tmofunc, + jiffies + + msecs_to_jiffies(1000 * (phba->fc_ratov << 1))); return 0; } -- 1.8.5.6 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH -next] fcoe: add missing destroy_workqueue() on error in fcoe_init()
Add the missing destroy_workqueue() before return from fcoe_init() in the fcoe transport register failed error handling case. Signed-off-by: Wei Yongjun --- drivers/scsi/fcoe/fcoe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 197dc62..9bd41a3 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -2495,7 +2495,7 @@ static int __init fcoe_init(void) if (rc) { printk(KERN_ERR "failed to register an fcoe transport, check " "if libfcoe is loaded\n"); - return rc; + goto out_destroy; } mutex_lock(&fcoe_config_mutex); @@ -2518,6 +2518,7 @@ static int __init fcoe_init(void) out_free: mutex_unlock(&fcoe_config_mutex); +out_destroy: destroy_workqueue(fcoe_wq); return rc; } -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH -next] ipr: Fix error return code in ipr_probe_ioa()
Fix to return error code -ENOMEM from the workqueue alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/scsi/ipr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 95e4834..bf85974 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -10219,6 +10219,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev, if (!ioa_cfg->reset_work_q) { dev_err(&pdev->dev, "Couldn't register reset workqueue\n"); + rc = -ENOMEM; goto out_free_irq; } } else -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 2/2] Add ioctl to issue ZBC/ZAC commands via block layer
Add support for ZBC ioctl's BLKREPORT- Issue Report Zones to device. BLKOPENZONE - Issue Zone Action: Open Zone command. BLKCLOSEZONE - Issue Zone Action: Close Zone command. BLKRESETZONE - Issue Zone Action: Reset Zone command. Signed-off-by: Shaun Tancheff --- v6: - Added GFP_DMA to gfp mask. v4: - Rebase on linux-next tag next-20160617. - Change bio flags to bio op's --- block/ioctl.c | 110 ++ include/uapi/linux/blkzoned_api.h | 6 +++ include/uapi/linux/fs.h | 1 + 3 files changed, 117 insertions(+) diff --git a/block/ioctl.c b/block/ioctl.c index ed2397f..a2a6c2c 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -194,6 +195,109 @@ int blkdev_reread_part(struct block_device *bdev) } EXPORT_SYMBOL(blkdev_reread_part); +static int blk_zoned_report_ioctl(struct block_device *bdev, fmode_t mode, + void __user *parg) +{ + int error = -EFAULT; + gfp_t gfp = GFP_KERNEL | GFP_DMA; + struct bdev_zone_report_io *zone_iodata = NULL; + int order = 0; + struct page *pgs = NULL; + u32 alloc_size = PAGE_SIZE; + unsigned long op_flags = 0; + u8 opt = 0; + + if (!(mode & FMODE_READ)) + return -EBADF; + + zone_iodata = (void *)get_zeroed_page(gfp); + if (!zone_iodata) { + error = -ENOMEM; + goto report_zones_out; + } + if (copy_from_user(zone_iodata, parg, sizeof(*zone_iodata))) { + error = -EFAULT; + goto report_zones_out; + } + if (zone_iodata->data.in.return_page_count > alloc_size) { + int npages; + + alloc_size = zone_iodata->data.in.return_page_count; + npages = (alloc_size + PAGE_SIZE - 1) >> PAGE_SHIFT; + pgs = alloc_pages(gfp, ilog2(npages)); + if (pgs) { + void *mem = page_address(pgs); + + if (!mem) { + error = -ENOMEM; + goto report_zones_out; + } + order = ilog2(npages); + memset(mem, 0, alloc_size); + memcpy(mem, zone_iodata, sizeof(*zone_iodata)); + free_page((unsigned long)zone_iodata); + zone_iodata = mem; + } else { + /* Result requires DMA capable memory */ + pr_err("Not enough memory available for request.\n"); + error = -ENOMEM; + goto report_zones_out; + } + } + opt = zone_iodata->data.in.report_option; + error = blkdev_issue_zone_report(bdev, op_flags, + zone_iodata->data.in.zone_locator_lba, opt, + pgs ? pgs : virt_to_page(zone_iodata), + alloc_size, GFP_KERNEL); + + if (error) + goto report_zones_out; + + if (copy_to_user(parg, zone_iodata, alloc_size)) + error = -EFAULT; + +report_zones_out: + if (pgs) + __free_pages(pgs, order); + else if (zone_iodata) + free_page((unsigned long)zone_iodata); + return error; +} + +static int blk_zoned_action_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg) +{ + unsigned int op = 0; + + if (!(mode & FMODE_WRITE)) + return -EBADF; + + /* +* When acting on zones we explicitly disallow using a partition. +*/ + if (bdev != bdev->bd_contains) { + pr_err("%s: All zone operations disallowed on this device\n", + __func__); + return -EFAULT; + } + + switch (cmd) { + case BLKOPENZONE: + op = REQ_OP_ZONE_OPEN; + break; + case BLKCLOSEZONE: + op = REQ_OP_ZONE_CLOSE; + break; + case BLKRESETZONE: + op = REQ_OP_ZONE_RESET; + break; + default: + pr_err("%s: Unknown action: %u\n", __func__, cmd); + return -EINVAL; + } + return blkdev_issue_zone_action(bdev, op, 0, arg, GFP_KERNEL); +} + static int blk_ioctl_discard(struct block_device *bdev, fmode_t mode, unsigned long arg, unsigned long flags) { @@ -568,6 +672,12 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, case BLKTRACESETUP: case BLKTRACETEARDOWN: return blk_trace_ioctl(bdev, cmd, argp); + case BLKREPORT: + return blk_zoned_report_ioctl(bdev, mode, argp); + case BLKOPENZONE: + case BLKCLOSEZONE: + case BLKRESETZONE: + return blk_zon
[PATCH v6 1/2] Add bio/request flags to issue ZBC/ZAC commands
Add op flags to access to zone information as well as open, close and reset zones: - REQ_OP_ZONE_REPORT - Query zone information (Report zones) - REQ_OP_ZONE_OPEN - Explictly open a zone for writing - REQ_OP_ZONE_CLOSE - Explictly close a zone - REQ_OP_ZONE_RESET - Reset Write Pointer to start of zone These op flags can be used to create bio's to control zoned devices through the block layer. This is useful for filesystems and device mappers that need explicit control of zoned devices such as Host Mananged and Host Aware SMR drives, Report zones is a device read that requires a buffer. Open, Close and Reset are device commands that have no associated data transfer. Sending an LBA of ~0 will attempt to operate on all zones. This is typically used with Reset to wipe a drive as a Reset behaves similar to TRIM in that all data in the zone(s) is deleted. The Finish zone command is intentionally not implimented as there is no current use case for that operation. Report zones currently defaults to reporting on all zones. It expected that support for the zone option flag will piggy back on streamid support. The report option flag is useful as it can reduce the number of zones in each report, but not critical. Signed-off-by: Shaun Tancheff --- v5: - In sd_setup_zone_action_cmnd, remove unused vars and fix switch indent - In blk-lib fix documentation v4: - Rebase on linux-next tag next-20160617. - Change bio flags to bio op's V3: - Rebase on Mike Cristie's separate bio operations - Update blkzoned_api.h to include report zones PARTIAL bit. V2: - Changed bi_rw to op_flags clarify sepeartion of bio op from flags. - Fixed memory leak in blkdev_issue_zone_report failing to put_bio(). - Documented opt in blkdev_issue_zone_report. - Removed include/uapi/linux/fs.h from this patch. --- MAINTAINERS | 9 ++ block/blk-lib.c | 95 + drivers/scsi/sd.c | 118 + drivers/scsi/sd.h | 1 + include/linux/bio.h | 7 +- include/linux/blk_types.h | 6 +- include/linux/blkzoned_api.h | 25 + include/uapi/linux/Kbuild | 1 + include/uapi/linux/blkzoned_api.h | 214 ++ 9 files changed, 474 insertions(+), 2 deletions(-) create mode 100644 include/linux/blkzoned_api.h create mode 100644 include/uapi/linux/blkzoned_api.h diff --git a/MAINTAINERS b/MAINTAINERS index 771c31c..32f5598 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12785,6 +12785,15 @@ F: Documentation/networking/z8530drv.txt F: drivers/net/hamradio/*scc.c F: drivers/net/hamradio/z8530.h +ZBC AND ZBC BLOCK DEVICES +M: Shaun Tancheff +W: http://seagate.com +W: https://github.com/Seagate/ZDM-Device-Mapper +L: linux-bl...@vger.kernel.org +S: Maintained +F: include/linux/blkzoned_api.h +F: include/uapi/linux/blkzoned_api.h + ZBUD COMPRESSED PAGE ALLOCATOR M: Seth Jennings L: linux...@kvack.org diff --git a/block/blk-lib.c b/block/blk-lib.c index 083e56f..6dcdcbf 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "blk.h" @@ -266,3 +267,97 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, return __blkdev_issue_zeroout(bdev, sector, nr_sects, gfp_mask); } EXPORT_SYMBOL(blkdev_issue_zeroout); + +/** + * blkdev_issue_zone_report - queue a report zones operation + * @bdev: target blockdev + * @op_flags: extra bio rw flags. If unsure, use 0. + * @sector:starting sector (report will include this sector). + * @opt: See: zone_report_option, default is 0 (all zones). + * @page: one or more contiguous pages. + * @pgsz: up to size of page in bytes, size of report. + * @gfp_mask: memory allocation flags (for bio_alloc) + * + * Description: + *Issue a zone report request for the sectors in question. + */ +int blkdev_issue_zone_report(struct block_device *bdev, unsigned int op_flags, +sector_t sector, u8 opt, struct page *page, +size_t pgsz, gfp_t gfp_mask) +{ + struct bdev_zone_report *conv = page_address(page); + struct bio *bio; + unsigned int nr_iovecs = 1; + int ret = 0; + + if (pgsz < (sizeof(struct bdev_zone_report) + + sizeof(struct bdev_zone_descriptor))) + return -EINVAL; + + bio = bio_alloc(gfp_mask, nr_iovecs); + if (!bio) + return -ENOMEM; + + conv->descriptor_count = 0; + bio->bi_iter.bi_sector = sector; + bio->bi_bdev = bdev; + bio->bi_vcnt = 0; + bio->bi_iter.bi_size = 0; + + bio_add_page(bio, page, pgsz, 0); + bio_set_op_attrs(bio, REQ_OP_ZONE_REPORT, op_flags); + ret = submit_bio_wait(bio); + + /* +* When our request it nak'd the underlying device maybe conventional +
[PATCH v6 0/2] Block layer support ZAC/ZBC commands
Hi Jens, This series is based on linus' current tip after the merge of 'for-4.8/core' As Host Aware drives are becoming available we would like to be able to make use of such drives. This series is also intended to be suitable for use by Host Managed drives. ZAC/ZBC drives add new commands for discovering and working with Zones. This extends the ZAC/ZBC support up to the block layer allowing direct control by file systems or device mapper targets. Also by deferring the zone handling to the authoritative subsystem there is an overall lower memory usage for holding the active zone information as well as clarifying responsible party for maintaining the write pointer for each active zone. By way of example a DM target may have several writes in progress. To sector (or lba) for those writes will each depend on the previous write. While the drive's write pointer will be updated as writes are completed the DM target will be maintaining both where the next write should be scheduled from and where the write pointer is based on writes completed w/o errors. Knowing the drive's zone topology enables DM targets and file systems to extend their block allocation schemes and issue write pointer resets (or discards) that are zone aligned. A perhaps non-obvious approach is that a conventional drive will returns a zone report descriptor with a single large conventional zone. Patches for util-linux can be found here: https://github.com/Seagate/ZDM-Device-Mapper/tree/master/patches/util-linux This patch is available here: https://github.com/stancheff/linux/tree/zbc.bio.v6 g...@github.com:stancheff/linux.git zbc.bio.v6 v6: - Fix page alloc to include DMA flag for ioctl. v5: - In sd_setup_zone_action_cmnd, remove unused vars and fix switch indent - In blk-lib fix documentation v4: - Rebase on linux-next tag next-20160617. - Change bio flags to bio op's - Dropped ata16 hackery V3: - Rebase on Mike Cristie's separate bio operations - Update blkzoned_api.h to include report zones PARTIAL bit. - Use zoned report reserved bit for ata-passthrough flag. V2: - Changed bi_rw to op_flags clarify sepeartion of bio op from flags. - Fixed memory leak in blkdev_issue_zone_report failing to put_bio(). - Documented opt in blkdev_issue_zone_report. - Moved include/uapi/linux/fs.h changes to patch 3 - Fixed commit message for first patch in series. Shaun Tancheff (2): Add bio/request flags to issue ZBC/ZAC commands Add ioctl to issue ZBC/ZAC commands via block layer MAINTAINERS | 9 ++ block/blk-lib.c | 95 block/ioctl.c | 110 +++ drivers/scsi/sd.c | 118 drivers/scsi/sd.h | 1 + include/linux/bio.h | 7 +- include/linux/blk_types.h | 6 +- include/linux/blkzoned_api.h | 25 + include/uapi/linux/Kbuild | 1 + include/uapi/linux/blkzoned_api.h | 220 ++ include/uapi/linux/fs.h | 1 + 11 files changed, 591 insertions(+), 2 deletions(-) create mode 100644 include/linux/blkzoned_api.h create mode 100644 include/uapi/linux/blkzoned_api.h -- 2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH -next] ipr: Fix error return code in ipr_probe_ioa()
Acked-by: Brian King -- Brian King Power Linux I/O IBM Linux Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/5] nvme-fabrics: Add host FC transport support
On Fri, 2016-07-22 at 17:23 -0700, James Smart wrote: A couple of minor comments: > Add nvme-fabrics host FC transport support > > Implements the FC-NVME T11 definition of how nvme fabric capsules are > performed on an FC fabric. Utilizes a lower-layer API to FC host > adapters > to send/receive FC-4 LS operations and FCP operations that comprise > NVME > over FC operation. > > The T11 definitions for FC-4 Link Services are implemented which > create > NVMeOF connections. Implements the hooks with blk-mq to then submit > admin > and io requests to the different connections. > > > Signed-off-by: James Smart snip... > + /* TODO: > + * assoc_rqst->assoc_cmd.cntlid = cpu_to_be16(?); > + * strncpy(assoc_rqst->assoc_cmd.hostid, ?, > + * min(FCNVME_ASSOC_HOSTID_LEN, NVMF_NQN_SIZE)); > + * strncpy(assoc_rqst->assoc_cmd.hostnqn, ?, > + * min(FCNVME_ASSOC_HOSTNQN_LEN, NVMF_NQN_SIZE]; > + */ What is the TODO here? more snip... > + > +static int > +nvme_fc_init_queue(struct nvme_fc_ctrl *ctrl, int idx, size_t > queue_size) > +{ > + struct nvme_fc_queue *queue; > + > + queue = &ctrl->queues[idx]; > + memset(queue, 0, sizeof(*queue)); > + queue->ctrl = ctrl; > + queue->qnum = idx; > + atomic_set(&queue->csn, 1); > + queue->dev = ctrl->dev; > + > + if (idx > 0) > + queue->cmnd_capsule_len = ctrl->ctrl.ioccsz * 16; > + else > + queue->cmnd_capsule_len = sizeof(struct > nvme_command); > + > + queue->queue_size = queue_size; > + > + /* > + * Considered whether we should allocate buffers for all > SQEs > + * and CQEs and dma map them - mapping their respective > entries > + * into the request structures (kernel vm addr and dma > address) > + * thus the driver could use the buffers/mappings directly. > + * It only makes sense if the LLDD would use them for its > + * messaging api. It's very unlikely most adapter api's > would use > + * a native NVME sqe/cqe. More reasonable if FC-NVME IU > payload > + * structures were used instead. For now - just pass the > + * sqe/cqes to the driver and let it deal with it. We'll > figure > + * out if the FC-NVME IUs make sense later. > + */ > + > + return 0; Slightly confused. Looks like in nvme_fc_configure_admin_queue() and nvme_fc_init_io_queues() check for this function returning an error, but nvme_fc_init_queue() never returns anything but 0. Should it return an error? Does the comments above imply that this function could change in the future such that it would return something other than 0? more more snip... > + > +static int > +nvme_fc_init_io_queues(struct nvme_fc_ctrl *ctrl) > +{ > + int i, ret; > + > + for (i = 1; i < ctrl->queue_count; i++) { > + ret = nvme_fc_init_queue(ctrl, i, ctrl > ->ctrl.sqsize); > + if (ret) { > + dev_info(ctrl->ctrl.device, > + "failed to initialize i/o queue %d: > %d\n", > + i, ret); > + } > + } > + > + return 0; Right now as-is nvme_fc_init_queue() will always return 0, but this function is hard-coded to return 0. Independent of what nvme_fc_init_queue() returns, this function should be returning 'ret' as "nvme_fc_create_io_queues()" has code to check if this function fails: > +static int > +nvme_fc_create_io_queues(struct nvme_fc_ctrl *ctrl) > +{ . . . > + dev_info(ctrl->ctrl.device, "creating %d I/O queues.\n", > + opts->nr_io_queues); > + > + ret = nvme_fc_init_io_queues(ctrl); > + if (ret) > + return ret; > + . . more more more snip... > +static int > +nvme_fc_start_fcp_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue > *queue, > + struct nvme_fc_fcp_op *op, u32 data_len, > + enum nvmefc_fcp_datadir io_dir) > +{ > + struct nvme_fc_cmd_iu *cmdiu = &op->cmd_iu; > + struct nvme_command *sqe = &cmdiu->sqe; > + u32 csn; > + int ret; > + > + /* format the FC-NVME CMD IU and fcp_req */ > + cmdiu->connection_id = cpu_to_be64(queue->connection_id); > + csn = atomic_inc_return(&queue->csn); > + cmdiu->csn = cpu_to_be32(csn); > + cmdiu->data_len = cpu_to_be32(data_len); > + switch (io_dir) { > + case NVMEFC_FCP_WRITE: > + cmdiu->flags = FCNVME_CMD_FLAGS_WRITE; > + break; > + case NVMEFC_FCP_READ: > + cmdiu->flags = FCNVME_CMD_FLAGS_READ; > + break; > + case NVMEFC_FCP_NODATA: > + cmdiu->flags = 0; > + break; > + } > + op->fcp_req.payload_length = data_len; > + op->fcp_req.io_dir = io_dir; > + op->fcp_req.transferred_length = 0; > + op->fcp_req.rcv_rsplen = 0; > + op->fcp_req.status = 0; > + > + /* > + * validate per fabric rules, set fields mandated by fabric > spec > + * as well as those by FC-NVME spec. > + */ > + WA
Re: [PATCH 2/5] nvme-fabrics: Add FC transport LLDD api definitions
On Mon, 2016-07-25 at 11:12 +0200, Johannes Thumshirn wrote: > On Fri, Jul 22, 2016 at 05:23:56PM -0700, James Smart wrote: > > > > nvme-fabrics: Add FC transport LLDD api definitions: > > > > Host: > > -LLDD registration with the host transport > > -registering host ports (local ports) and target ports seen on > >fabric (remote ports) > > -Data structures and call points for FC-4 LS's and FCP IO requests > > > > Target: > > -LLDD registration with the target transport > > -registering nvme subsystem ports (target ports) > > -Data structures and call points for reception of FC-4 LS's and > >FCP IO requests, and callbacks to perform data and rsp transfers > >for the io. > > > > > > Signed-off-by: James Smart > > Acked-by: Johannes Thumshirn Acked-by: Jay Freyensee > -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/5] nvme-fabrics: Add FC transport FC-NVME definitions
On Mon, 2016-07-25 at 10:56 +0200, Johannes Thumshirn wrote: > On Fri, Jul 22, 2016 at 05:23:55PM -0700, James Smart wrote: > > > > nvme-fabrics: Add FC transport FC-NVME definitions: > > - Formats for Cmd, Data, Rsp IUs > > - Formats FC-4 LS definitions > > > > > > Signed-off-by: James Smart > > Acked-by: Johannes Thumshirn Acked-by: Jay Freyensee > -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html