Print this page
NEX-3508 CLONE - Port NEX-2946 Add UNMAP/TRIM functionality to ZFS and illumos
Reviewed by: Josef Sipek <josef.sipek@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Conflicts:
    usr/src/uts/common/io/scsi/targets/sd.c
    usr/src/uts/common/sys/scsi/targets/sddef.h
NEX-3023 Panics and hangs when using write_same and compare_and_write
Review by: Bayard Bell <bayard.bell@nexenta.com>
Review by: Rick McNeal <rick.mcneal@nexenta.com>
Review by: Jean McCormack <jean.mccormack@nexenta.com>
Approved by: Jean McCormack <jean.mccormack@nexenta.com>
Related bug: NEX-2723 Kernel panic in xfer_completion code for write_same (0x93) and compare_and_write (0x89)
NEX-1965 Page fault at netbios_first_level_name_decode+0xbb
Support simultaneous compare_and_write operations for VAAI
Bug IDs SUP-505
                SUP-1768
                SUP-1928
Code Reviewers:
        Sarah Jelinek
        Jeffry Molanus
        Albert Lee
        Harold Shaw
OS-69 Open source VAAI
re #7936 rb3706 Support for COMSTAR/OEM
re #8002 rb3706 Allow setting iSCSI vendor ID via stmf_sbd.conf
re #11454 rb3750 Fix inconsistent vid/pid in stmf
8226 nza-kernel needs to be buildable by itself
Re #6790 backspace should perform delete on console
VAAI (XXX ATS support for COMSTAR, YYY Block-copy support for COMSTAR)

*** 16,39 **** * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. ! * ! * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ #ifndef _STMF_SBD_H #define _STMF_SBD_H #ifdef __cplusplus extern "C" { #endif typedef stmf_status_t sbd_status_t; extern char sbd_vendor_id[]; extern char sbd_product_id[]; extern char sbd_revision[]; extern char *sbd_mgmt_url; extern uint16_t sbd_mgmt_url_alloc_size; --- 16,42 ---- * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ + /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. ! * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ #ifndef _STMF_SBD_H #define _STMF_SBD_H + #include <sys/dkio.h> + #ifdef __cplusplus extern "C" { #endif typedef stmf_status_t sbd_status_t; + #include "ats_copy_mgr.h" extern char sbd_vendor_id[]; extern char sbd_product_id[]; extern char sbd_revision[]; extern char *sbd_mgmt_url; extern uint16_t sbd_mgmt_url_alloc_size;
*** 52,61 **** --- 55,65 ---- #define SBD_NOT_FOUND (SBD_FAILURE | STMF_FSC(5)) #define SBD_ALLOC_FAILURE (SBD_FAILURE | STMF_FSC(6)) #define SBD_FILEIO_FAILURE (SBD_FAILURE | STMF_FSC(7)) #define SBD_IO_PAST_EOF (SBD_FAILURE | STMF_FSC(8)) #define SBD_BUSY (SBD_FAILURE | STMF_FSC(9)) + #define SBD_COMPARE_FAILED (SBD_FAILURE | STMF_FSC(10)) #define SHARED_META_DATA_SIZE 65536 #define SBD_META_OFFSET 4096 #define SBD_MIN_LU_SIZE (1024 * 1024)
*** 242,251 **** --- 246,256 ---- uint64_t sl_max_xfer_len; /* used for zvols */ struct sbd_it_data *sl_it_list; struct sbd_pgr *sl_pgr; uint64_t sl_rs_owner_session_id; + list_t sl_ats_io_list; } sbd_lu_t; /* * sl_flags */
*** 298,309 **** uint32_t *bufsizep); sbd_status_t sbd_write_lu_info(sbd_lu_t *sl); sbd_status_t sbd_flush_data_cache(sbd_lu_t *sl, int fsync_done); sbd_status_t sbd_wcd_set(int wcd, sbd_lu_t *sl); void sbd_wcd_get(int *wcd, sbd_lu_t *sl); ! int sbd_unmap(sbd_lu_t *, uint64_t, uint64_t); #ifdef __cplusplus } #endif #endif /* _STMF_SBD_H */ --- 303,319 ---- uint32_t *bufsizep); sbd_status_t sbd_write_lu_info(sbd_lu_t *sl); sbd_status_t sbd_flush_data_cache(sbd_lu_t *sl, int fsync_done); sbd_status_t sbd_wcd_set(int wcd, sbd_lu_t *sl); void sbd_wcd_get(int *wcd, sbd_lu_t *sl); ! int sbd_unmap(sbd_lu_t *sl, dkioc_free_list_t *dfl); + void sbd_handle_short_write_transfers(scsi_task_t *, stmf_data_buf_t *, + uint32_t); + void sbd_handle_short_read_transfers(scsi_task_t *, stmf_data_buf_t *, + uint8_t *, uint32_t, uint32_t); + #ifdef __cplusplus } #endif #endif /* _STMF_SBD_H */