ibmvscsis: Initial commit of IBM VSCSI Tgt Driver
Subsystems (6)
PATCH v2 1/1 ibmvscsis: Initial commit of IBM VSCSI Tgt Driver
This driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119
and http://marc.info/?t=129734085600004&r=1&w=2
The driver provides a virtual SCSI device on IBM Power Servers.
When reviving the old libsrp, I stripped out all that utilized scsi to submit commands to the target. Hence there is no more scsi_tgt_if_*, and scsi_transport_* files and fully utilizes LIO instead. This driver does however use the SRP protocol for communication between guests/and or hosts, but its all synchronous data transfers due to the utilization of H_COPY_RDMA, a VIO mechanism which means that others like ib_srp, ib_srpt which are asynchronous can't use this driver. This was also the reason for moving libsrp out of the drivers/scsi/. and into the ibmvscsi folder.
Version 1:
This initial commit contains WIP of the IBM VSCSI Target Fabric Module. It currently supports read/writes, and I have tested the ability to create a file backstore with the driver, install RHEL, and then boot up the partition via filio backstore through the driver.
Version 2:
Addressing Bart's Comments, contains cleaning up the code for styling and also addresses Bart's comments.
Removed forward declarations and re-organizes thefunctions within the driver. This patch also fixes MAINTAINERS for ibmvscsis.
Cleaned up indentations and a bug in send_adapter_info where on the error case it wont free dma allocation.
Lastly, this disregards my previous post splitting up the changes into patches, and makes them ammends with different versions of the original patch. This patch also contains internal IBM sign offs.
--- MAINTAINERS | 10 + drivers/scsi/Kconfig | 30 + drivers/scsi/Makefile | 2 + drivers/scsi/ibmvscsi/Makefile | 2 + drivers/scsi/ibmvscsi/ibmvscsis.c | 1932 +++++++++++++++++++++++++++++++++++++ drivers/scsi/ibmvscsi/ibmvscsis.h | 150 +++ drivers/scsi/ibmvscsi/libsrp.c | 386 ++++++++ drivers/scsi/ibmvscsi/libsrp.h | 91 ++ 8 files changed, 2603 insertions(+) create mode 100644 drivers/scsi/ibmvscsi/ibmvscsis.c create mode 100644 drivers/scsi/ibmvscsi/ibmvscsis.h create mode 100644 drivers/scsi/ibmvscsi/libsrp.c create mode 100644 drivers/scsi/ibmvscsi/libsrp.h
MAINTAINERS +10 -0
@@ -5381,6 +5381,16 @@ S: Supported F: drivers/scsi/ibmvscsi/ibmvscsi* F: drivers/scsi/ibmvscsi/viosrp.h +IBM Power Virtual SCSI Device Target Driver +M: Bryant G. Ly <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: drivers/scsi/ibmvscsi/ibmvscsis.c +F: drivers/scsi/ibmvscsi/ibmvscsis.h +F: drivers/scsi/ibmvscsi/libsrp.c +F: drivers/scsi/ibmvscsi/libsrp.h + IBM Power Virtual FC Device Drivers M: Tyrel Datwyler <[email protected]> L: [email protected]
drivers/scsi/Kconfig +30 -0
@@ -847,6 +847,23 @@ config SCSI_IBMVSCSI To compile this driver as a module, choose M here: the module will be called ibmvscsi. +config SCSI_IBMVSCSIS + tristate "IBM Virtual SCSI Server support" + depends on PPC_PSERIES && SCSI_SRP && TARGET_CORE + help + This is the IBM POWER Virtual SCSI Target Server + This driver uses the SRP protocol for communication betwen servers + guest and/or the host that run on the same server. + More information on VSCSI protocol can be found at www.power.org + + The userspace configuration needed to initialize the driver can be + be found here: + + https://github.com/powervm/ibmvscsis/wiki/Configuration + + To compile this driver as a module, choose M here: the + module will be called ibmvstgt. + config SCSI_IBMVFC tristate "IBM Virtual FC support" depends on PPC_PSERIES && SCSI
@@ -1728,6 +1745,19 @@ config SCSI_PM8001 This driver supports PMC-Sierra PCIE SAS/SATA 8x6G SPC 8001 chip based host adapters. +config SCSI_SRP + tristate "SCSI RDMA Protocol helper library" + depends on SCSI && PCI + help + This SCSI SRP module is a library for ibmvscsi target driver. + This module can only be used by SRP drivers that utilize synchronous + data transfers and not by SRP drivers that use asynchronous. + + If you wish to use SRP target drivers, say Y. + + To compile this driver as a module, choose M here. The module will + be called libsrp. + config SCSI_BFA_FC tristate "Brocade BFA Fibre Channel Support" depends on PCI && SCSI
drivers/scsi/Makefile +2 -0
@@ -127,7 +127,9 @@ obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o obj-$(CONFIG_SCSI_SNI_53C710) += 53c700.o sni_53c710.o obj-$(CONFIG_SCSI_NSP32) += nsp32.o obj-$(CONFIG_SCSI_IPR) += ipr.o +obj-$(CONFIG_SCSI_SRP) += ibmvscsi/ obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsi/ obj-$(CONFIG_SCSI_IBMVFC) += ibmvscsi/ obj-$(CONFIG_SCSI_HPTIOP) += hptiop.o obj-$(CONFIG_SCSI_STEX) += stex.o
drivers/scsi/ibmvscsi/Makefile +2 -0
@@ -1,2 +1,4 @@ obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi.o +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o obj-$(CONFIG_SCSI_IBMVFC) += ibmvfc.o +obj-$(CONFIG_SCSI_SRP) += libsrp.o
drivers/scsi/ibmvscsi/ibmvscsis.c new file +1932 -0
1,932 lines not on this page · raw message
drivers/scsi/ibmvscsi/ibmvscsis.h new file +150 -0
150 lines not on this page · raw message
drivers/scsi/ibmvscsi/libsrp.c new file +386 -0
386 lines not on this page · raw message
drivers/scsi/ibmvscsi/libsrp.h new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
2.5.4 (Apple Git-61)
PATCH v3 1/1 ibmvscsis: Initial commit of IBM VSCSI Tgt Driver
Version 1:
This initial commit contains WIP of the IBM VSCSI Target Fabric Module. It currently supports read/writes, and I have tested the ability to create a file backstore with the driver, install RHEL, and then boot up the partition via filio backstore through the driver.
This driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119
and http://marc.info/?t=129734085600004&r=1&w=2
The driver provides a virtual SCSI device on IBM Power Servers.
When reviving the old libsrp, I stripped out all that utilized scsi to submit commands to the target. Hence there is no more scsi_tgt_if_*, and scsi_transport_* files and fully utilizes LIO instead. This driver does however use the SRP protocol for communication between guests/and or hosts, but its all synchronous data transfers due to the utilization of H_COPY_RDMA, a VIO mechanism which means that others like ib_srp, ib_srpt which are asynchronous can't use this driver. This was also the reason for moving libsrp out of the drivers/scsi/. and into the ibmvscsi folder.
--- MAINTAINERS | 10 + drivers/scsi/Kconfig | 27 +- drivers/scsi/Makefile | 2 +- drivers/scsi/ibmvscsi/Makefile | 4 + drivers/scsi/ibmvscsi/ibmvscsi_tgt.c | 1932 ++++++++++++++++++++++++++++++++++ drivers/scsi/ibmvscsi/ibmvscsi_tgt.h | 169 +++ drivers/scsi/ibmvscsi/libsrp.c | 386 +++++++ drivers/scsi/ibmvscsi/libsrp.h | 91 ++ drivers/scsi/libsrp.c | 447 -------- include/scsi/libsrp.h | 78 -- 10 files changed, 2610 insertions(+), 536 deletions(-) create mode 100644 drivers/scsi/ibmvscsi/ibmvscsi_tgt.c create mode 100644 drivers/scsi/ibmvscsi/ibmvscsi_tgt.h create mode 100644 drivers/scsi/ibmvscsi/libsrp.c create mode 100644 drivers/scsi/ibmvscsi/libsrp.h delete mode 100644 drivers/scsi/libsrp.c delete mode 100644 include/scsi/libsrp.h
MAINTAINERS +10 -0
@@ -5451,6 +5451,16 @@ S: Supported F: drivers/scsi/ibmvscsi/ibmvscsi* F: drivers/scsi/ibmvscsi/viosrp.h +IBM Power Virtual SCSI Device Target Driver +M: Bryant G. Ly <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: drivers/scsi/ibmvscsi/ibmvscsis.c +F: drivers/scsi/ibmvscsi/ibmvscsis.h +F: drivers/scsi/ibmvscsi/libsrp.c +F: drivers/scsi/ibmvscsi/libsrp.h + IBM Power Virtual FC Device Drivers M: Tyrel Datwyler <[email protected]> L: [email protected]
drivers/scsi/Kconfig +17 -10
@@ -848,6 +848,23 @@ config SCSI_IBMVSCSI To compile this driver as a module, choose M here: the module will be called ibmvscsi. +config SCSI_IBMVSCSIS + tristate "IBM Virtual SCSI Server support" + depends on PPC_PSERIES && TARGET_CORE && SCSI && PCI + help + This is the IBM POWER Virtual SCSI Target Server + This driver uses the SRP protocol for communication betwen servers + guest and/or the host that run on the same server. + More information on VSCSI protocol can be found at www.power.org + + The userspace configuration needed to initialize the driver can be + be found here: + + https://github.com/powervm/ibmvscsis/wiki/Configuration + + To compile this driver as a module, choose M here: the + module will be called ibmvstgt. + config SCSI_IBMVFC tristate "IBM Virtual FC support" depends on PPC_PSERIES && SCSI
@@ -1729,16 +1746,6 @@ config SCSI_PM8001 This driver supports PMC-Sierra PCIE SAS/SATA 8x6G SPC 8001 chip based host adapters. -config SCSI_SRP - tristate "SCSI RDMA Protocol helper library" - depends on SCSI && PCI - select SCSI_TGT - help - If you wish to use SRP target drivers, say Y. - - To compile this driver as a module, choose M here: the - module will be called libsrp. - config SCSI_BFA_FC tristate "Brocade BFA Fibre Channel Support" depends on PCI && SCSI
drivers/scsi/Makefile +1 -1
@@ -127,8 +127,8 @@ obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o obj-$(CONFIG_SCSI_SNI_53C710) += 53c700.o sni_53c710.o obj-$(CONFIG_SCSI_NSP32) += nsp32.o obj-$(CONFIG_SCSI_IPR) += ipr.o -obj-$(CONFIG_SCSI_SRP) += libsrp.o obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsi/ obj-$(CONFIG_SCSI_IBMVFC) += ibmvscsi/ obj-$(CONFIG_SCSI_HPTIOP) += hptiop.o obj-$(CONFIG_SCSI_STEX) += stex.o
drivers/scsi/ibmvscsi/Makefile +4 -0
@@ -1,2 +1,6 @@ obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi.o +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o obj-$(CONFIG_SCSI_IBMVFC) += ibmvfc.o + +ibmvscsis-objs := libsrp.o ibmvscsi_tgt.o +
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c new file +1932 -0
1,932 lines not on this page · raw message
drivers/scsi/ibmvscsi/ibmvscsi_tgt.h new file +169 -0
169 lines not on this page · raw message
drivers/scsi/ibmvscsi/libsrp.c new file +386 -0
386 lines not on this page · raw message
drivers/scsi/ibmvscsi/libsrp.h new file +91 -0
91 lines not on this page · raw message
drivers/scsi/libsrp.c deleted +0 -447
352 lines not on this page · raw message
include/scsi/libsrp.h deleted +0 -78
78 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
--
V2
Addressed comments from Bart/Joe in regards to styling and code structure
V3
Addressed James Bottomley's comments in regards to having the old libsrp reverted to make it clear that we are resurrecting the old vscsi target driver and making changes to it to utilize LIO. I also made libsrp a linked file to the ibmvscsi module per Jame's comments.
2.5.4 (Apple Git-61)
Part of the diff is not shown here. View the raw message.
Hi Bryant,
On Fri, 2016-05-27 at 09:32 -0500, Bryant G. Ly wrote
Quoted 5 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c new file +0
-0
<SNIP>
Quoted 34 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c new file +34
-0+ +static struct se_portal_group *ibmvscsis_make_nexus (struct ibmvscsis_tport + *tport, +const char *name) +{ +struct se_node_acl *acl; + +if (tport->se_sess) { +pr_debug ("tport->se_sess already exists\n" ); +return &tport->se_tpg; + } + +/* +* Initialize the struct se_session pointer and setup tagpool +* for struct ibmvscsis_cmd descriptors +*/ + tport->se_sess =transport_init_session (TARGET_PROT_NORMAL ); +if (IS_ERR (tport->se_sess)) + goto transport_init_fail; + +/* +* Since we are running in 'demo mode' this call will generate a +* struct se_node_acl for the ibmvscsis struct se_portal_group with +* the SCSI Initiator port name of the passed configfs group 'name'. +*/ + + acl =core_tpg_check_initiator_node_acl (&tport->se_tpg, + (unsigned char *)name); +if (!acl) { +pr_debug ("core_tpg_check_initiator_node_acl() failed for %s\n" , + name); + goto acl_failed; + } + tport->se_sess->se_node_acl = acl;
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c line 626
Quoted 10 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c new file +10
-0+ +/* +* Now register the TCM ibmvscsis virtual I_T Nexus as active. +*/ +transport_register_session (&tport->se_tpg, + tport->se_sess->se_node_acl, + tport->se_sess, tport); + + tport->se_sess->se_tpg = &tport->se_tpg; +
FYI, starting in v4.6 these three calls are handled directly by a new target_alloc_session() helper.
No objection to leaving this as-is for now to make it easier to run atop unmodified v4.4 target code, but note you'll want to be converting this post merge.
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c line 1438
Quoted 10 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c new file +9
-0+static int ibmvscsis_shutdown_session (struct se_session *se_sess) +{ +return 0 ; +} + +static void ibmvscsis_close_session (struct se_session *se_sess) +{ +} +
These two target_core_fabric_ops callers have been made optional for v4.7+
Quoted 5 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.h new file +0
-0
<SNIP>
Quoted 6 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.h new file +6
-0+ +struct client_info { +#define SRP_VERSION "16.a" +char srp_version[8 ]; +/* root node property ibm,partition-name */ +char partition_name[PARTITION_NAMELEN ];
drivers/scsi/ibmvscsi/ibmvscsi_tgt.h line 80
Quoted 10 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.h new file +10
-0+/* root node property ibm,partition-no */ +u32 partition_number; +/* initially 1 */ +u32 mad_version; +u32 os_type; +}; + +struct ibmvscsis_cmd { +/* Used for libsrp processing callbacks */ +struct scsi_cmnd sc;
AFAICT, struct scsi_cmnd is only being used for passing io memory descriptors and struct iu_entry via sc->SCp.ptr between ibmvscsi_tgt + libsrp.
Now with the other legacy libsrp.c Scsi_Host related bits removed, it should be easy to convert the rest in order to drop the last vestiges of SCSI host LLD structures from ibmvscsi_tgt code.
Quoted 7 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.h new file +7
-0+/* Used for TCM Core operations */ +struct se_cmd se_cmd; +/* Sense buffer that will be mapped into outgoing status */ +unsigned char sense_buf[TRANSPORT_SENSE_BUFFER ]; +u32 lun; +}; +
<SNIP>
Quoted 41 lines
drivers/scsi/ibmvscsi/libsrp.h new file +35
-0@@ -0,0 +1,91 @@ +#ifndef __LIBSRP_H__ +#define __LIBSRP_H__ + +#include <linux/list.h> +#include <linux/kfifo.h> +#include <scsi/scsi_cmnd.h> +#include <scsi/scsi_host.h> +#include <scsi/srp.h> +#include <target/target_core_base.h> + +enum srp_task_attributes { +SRP_SIMPLE_TASK =0 , +SRP_HEAD_TASK =1 , +SRP_ORDERED_TASK =2 , +SRP_ACA_TASK =4 +}; + +enum iue_flags { +V_DIOVER , +V_WRITE , +V_LINKED , +V_FLYING , +}; + +enum { +SRP_TASK_MANAGEMENT_FUNCTION_COMPLETE =0 , +SRP_REQUEST_FIELDS_INVALID =2 , +SRP_TASK_MANAGEMENT_FUNCTION_NOT_SUPPORTED =4 , +SRP_TASK_MANAGEMENT_FUNCTION_FAILED =5 +}; + +struct srp_buf { +dma_addr_t dma; +void *buf; +};
drivers/scsi/ibmvscsi/libsrp.h line 45
Quoted 10 lines
drivers/scsi/ibmvscsi/libsrp.h new file +10
-0+ +struct srp_queue { +void *pool; +void *items; +struct kfifo queue; +spinlock_t lock; +}; + +struct srp_target { +struct Scsi_Host *shost;
Unused.
Quoted 15 lines
drivers/scsi/ibmvscsi/libsrp.h new file +13
-0+struct se_device *tgt; +struct device *dev; + +spinlock_t lock; +struct list_head cmd_queue; + +size_t srp_iu_size; +struct srp_queue iu_queue; +size_t rx_ring_size; +struct srp_buf **rx_ring; + +void *ldata; +};
Quoted 9 lines
V2
Addressed comments from Bart/Joe in regards to styling and code structureV3
Addressed James Bottomley's comments in regards to having the old libsrp reverted to make it clear that we are resurrecting the old vscsi target driver and making changes to it to utilize LIO. I also made libsrp a linked file to the ibmvscsi module per Jame's comments.
Btw, the patch series changelog should go at the top of the email.
A few comments below, not really a full review yet:
Quoted 10 lines
When reviving the old libsrp, I stripped out all that utilized scsi to submit commands to the target. Hence there is no more scsi_tgt_if_*, and scsi_transport_* files and fully utilizes LIO instead. This driver does however use the SRP protocol for communication between guests/and or hosts, but its all synchronous data transfers due to the utilization of
H_COPY_RDMA, a VIO mechanism which means that others likeib_srp,ib_srptwhich are asynchronous can't use this driver. This was also the reason for moving libsrp out of thedrivers/scsi/. and into the ibmvscsi folder.
Is there any chared code with the ibmvscsi initiator? If yes please make the initiator use it. If not please drop the separate libsrp concept and add the code directly to the vscsi target driver.
drivers/scsi/Kconfig config SCSI_PM8001 · line 1759
Quoted 12 lines
drivers/scsi/Kconfig +12
-0+config SCSI_SRP + tristate "SCSI RDMA Protocol helper library" + depends on SCSI && PCI + help + This SCSI SRP module is a library for ibmvscsi target driver. + This module can only be used by SRP drivers that utilize synchronous + data transfers and not by SRP drivers that use asynchronous. + + If you wish to use SRP target drivers, say Y. + + To compile this driver as a module, choose M here. The module will + be called libsrp.
But either way this shouldn't an exposed config option.
drivers/scsi/ibmvscsi/ibmvscsis.c line 41
Quoted 5 lines
drivers/scsi/ibmvscsi/ibmvscsis.c new file +5
-0+#include <scsi/scsi.h> +#include <scsi/scsi_host.h> +#include <scsi/scsi_device.h> +#include <scsi/scsi_cmnd.h> +#include <scsi/scsi_tcq.h>
Most of this shouldn't be needed in a target driver, please start with scsi/scsi_proto.h and scsi/scsi_common.h and see if you really need anything else.
Quoted 1 line
+#include <
target/target_core_backend.h>
As the name suggest this is for storage backends, a fronted driver shouldn't really need it.
Quoted 10 lines
drivers/scsi/ibmvscsi/ibmvscsis.c new file +10
-0+static void ibmvscsis_modify_std_inquiry (struct se_cmd *se_cmd) +{ +struct se_device *dev = se_cmd->se_dev; +u32 cmd_len = se_cmd->data_length; +unsigned char *buf =NULL ; + +if (cmd_len <=INQ_DATA_OFFSET ) +return ; + + buf =transport_kmap_data_sg (se_cmd);
drivers/scsi/ibmvscsi/ibmvscsis.c line 284
Quoted 10 lines
drivers/scsi/ibmvscsi/ibmvscsis.c new file +10
-0+if (buf) { +memcpy (&buf[8 ],"IBM " ,8 ); +if (dev->transport->get_device_type (dev) ==TYPE_ROM ) +memcpy (&buf[16 ],"VOPTA " ,16 ); +else +memcpy (&buf[16 ],"3303 NVDISK" ,16 ); +memcpy (&buf[32 ],"0001" ,4 ); +transport_kunmap_data_sg (se_cmd); + } +}
Eww, why?
Quoted 8 lines
drivers/scsi/ibmvscsi/ibmvscsis.c new file +8
-0+static struct se_portal_group *ibmvscsis_make_nexus (struct ibmvscsis_tport + *tport, +const char *name) +{ +struct se_node_acl *acl; + +if (tport->se_sess) { +pr_debug ("tport->se_sess already exists\n" );
drivers/scsi/ibmvscsi/ibmvscsis.c line 605
Quoted 10 lines
drivers/scsi/ibmvscsi/ibmvscsis.c new file +10
-0+return &tport->se_tpg; + } + +/* +* Initialize the struct se_session pointer and setup tagpool +* for struct ibmvscsis_cmd descriptors +*/ + tport->se_sess =transport_init_session (TARGET_PROT_NORMAL ); +if (IS_ERR (tport->se_sess)) + goto transport_init_fail;
Please use target_alloc_session instead of open coding it.
drivers/scsi/ibmvscsi/ibmvscsis.c line 775
Quoted 4 lines
drivers/scsi/ibmvscsi/ibmvscsis.c new file +4
-0+static int tcm_queuecommand (struct ibmvscsis_adapter *adapter, +struct ibmvscsis_cmd *vsc, +struct srp_cmd *scmd) +{
should be merged into the caller.
drivers/scsi/ibmvscsi/ibmvscsis.c line 812
Quoted 2 lines
drivers/scsi/ibmvscsi/ibmvscsis.c new file +2
-0+ unpacked_lun =ibmvscsis_unpack_lun ((u8 *)&scmd->lun, +sizeof (scmd->lun));
Thois should probably use scsilun_to_int, see commit e1dd413ccff7a35c4d8b14781668ed27bae64823 in the srp target for �n example.
Quoted 4 lines
drivers/scsi/ibmvscsi/ibmvscsis.c new file +4
-0+ ret =target_submit_cmd (se_cmd, adapter->tport.se_sess, + &scmd->cdb[0 ], &vsc->sense_buf[0 ], unpacked_lun, + data_len, attr,srp_cmd_direction (scmd), +TARGET_SCF_ACK_KREF );
drivers/scsi/ibmvscsi/ibmvscsis.c line 827
Quoted 10 lines
drivers/scsi/ibmvscsi/ibmvscsis.c new file +10
-0+if (ret !=0 ) { + ret =TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE ; +pr_debug ("tcm_queuecommand fail submit_cmd\n" ); + goto send_sense; + } +return 0 ; + +send_sense: +transport_send_check_condition_and_sense (&vsc->se_cmd, ret,0 ); +transport_generic_free_cmd (&vsc->se_cmd,0 );
this will cause a crash if target_submit_cmd failed.
drivers/scsi/ibmvscsi/ibmvscsis.c line 832
Quoted 2 lines
drivers/scsi/ibmvscsi/ibmvscsis.c new file +2
-0+static int ibmvscsis_queuecommand (struct ibmvscsis_adapter *adapter, +struct iu_entry *iue)
please give this function a more sensible name.
drivers/scsi/ibmvscsi/ibmvscsis.c line 1516
Quoted 4 lines
drivers/scsi/ibmvscsi/ibmvscsis.c new file +4
-0+if (scsi_sg_count (sc)) { +if (srp->cdb[0 ] ==REPORT_LUNS && + adapter->client_data.os_type !=LINUX ) +ibmvscsis_modify_rep_luns (se_cmd);
A fabrics driver has no business doing this. Add support to the core for different LUN addressing modes instead.
PATCH v4 1/1 ibmvscsis: Initial commit of IBM VSCSI Tgt Driver
In reply to Nicholas A. BellingerThis driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119
The driver provides a virtual SCSI device on IBM Power Servers.
This patch contains the fifth version for an initial merge of the tcm ibmvscsis driver. More information on this driver and config can be found:
https://github.com/powervm/ibmvscsis/wiki/Configuration
http://www.linux-iscsi.org/wiki/IBM_vSCSI
---
Version 5:
- Changed some print statements to dev_err.
-Also changed to use target_alloc_session instead of manually coding it.
- Removed scsi_cmnd and scsi_host bits removed from libsrp to completely
- Stripped out un-needed includes.
- Added pre-allocation of commands before IO starts.
- Added Support for Transport event, fast-fail support, MESSAGE_IN_CRQ format
- Changed the way queues are handled for better performance, and state mgmt.
Version 3:
- Revert old libsrp and make it clear resurrection old vscsi target driver
- Made libsrp a linked file to the ibmvscsis module
Version 2:
-Fixed comments from Bart/Joe in regards to styling and code structure
Version 1:
This initial commit contains WIP of the IBM VSCSI Target Fabric Module. It currently supports read/writes, and I have tested the ability to create a file backstore with the driver, install RHEL, and then boot up the partition via filio backstore through the driver.
MAINTAINERS | 11 + drivers/scsi/Kconfig | 27 +- drivers/scsi/Makefile | 2 +- drivers/scsi/ibmvscsi/Makefile | 4 + drivers/scsi/ibmvscsi/ibmvscsi_tgt.c | 4184 ++++++++++++++++++++++++++++++++++ drivers/scsi/ibmvscsi/ibmvscsi_tgt.h | 347 +++ drivers/scsi/ibmvscsi/libsrp.c | 427 ++++ drivers/scsi/ibmvscsi/libsrp.h | 123 + drivers/scsi/libsrp.c | 447 ---- include/scsi/libsrp.h | 78 - 10 files changed, 5114 insertions(+), 536 deletions(-) create mode 100644 drivers/scsi/ibmvscsi/ibmvscsi_tgt.c create mode 100644 drivers/scsi/ibmvscsi/ibmvscsi_tgt.h create mode 100644 drivers/scsi/ibmvscsi/libsrp.c create mode 100644 drivers/scsi/ibmvscsi/libsrp.h delete mode 100644 drivers/scsi/libsrp.c delete mode 100644 include/scsi/libsrp.h
MAINTAINERS +11 -0
@@ -5683,6 +5683,17 @@ S: Supported F: drivers/scsi/ibmvscsi/ibmvscsi* F: drivers/scsi/ibmvscsi/viosrp.h +IBM Power Virtual SCSI Device Target Driver +M: Bryant G. Ly <[email protected]> +M: Michael Cyr <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: drivers/scsi/ibmvscsi/ibmvscsis.c +F: drivers/scsi/ibmvscsi/ibmvscsis.h +F: drivers/scsi/ibmvscsi/libsrp.c +F: drivers/scsi/ibmvscsi/libsrp.h + IBM Power Virtual FC Device Drivers M: Tyrel Datwyler <[email protected]> L: [email protected]
drivers/scsi/Kconfig +17 -10
@@ -838,6 +838,23 @@ config SCSI_IBMVSCSI To compile this driver as a module, choose M here: the module will be called ibmvscsi. +config SCSI_IBMVSCSIS + tristate "IBM Virtual SCSI Server support" + depends on PPC_PSERIES && TARGET_CORE && SCSI && PCI + help + This is the IBM POWER Virtual SCSI Target Server + This driver uses the SRP protocol for communication betwen servers + guest and/or the host that run on the same server. + More information on VSCSI protocol can be found at www.power.org + + The userspace configuration needed to initialize the driver can be + be found here: + + https://github.com/powervm/ibmvscsis/wiki/Configuration + + To compile this driver as a module, choose M here: the + module will be called ibmvstgt. + config SCSI_IBMVFC tristate "IBM Virtual FC support" depends on PPC_PSERIES && SCSI
@@ -1719,16 +1736,6 @@ config SCSI_PM8001 This driver supports PMC-Sierra PCIE SAS/SATA 8x6G SPC 8001 chip based host adapters. -config SCSI_SRP - tristate "SCSI RDMA Protocol helper library" - depends on SCSI && PCI - select SCSI_TGT - help - If you wish to use SRP target drivers, say Y. - - To compile this driver as a module, choose M here: the - module will be called libsrp. - config SCSI_BFA_FC tristate "Brocade BFA Fibre Channel Support" depends on PCI && SCSI
drivers/scsi/Makefile +1 -1
@@ -127,8 +127,8 @@ obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o obj-$(CONFIG_SCSI_SNI_53C710) += 53c700.o sni_53c710.o obj-$(CONFIG_SCSI_NSP32) += nsp32.o obj-$(CONFIG_SCSI_IPR) += ipr.o -obj-$(CONFIG_SCSI_SRP) += libsrp.o obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsi/ obj-$(CONFIG_SCSI_IBMVFC) += ibmvscsi/ obj-$(CONFIG_SCSI_HPTIOP) += hptiop.o obj-$(CONFIG_SCSI_STEX) += stex.o
drivers/scsi/ibmvscsi/Makefile +4 -0
@@ -1,2 +1,6 @@ obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi.o +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o obj-$(CONFIG_SCSI_IBMVFC) += ibmvfc.o + +ibmvscsis-objs := libsrp.o ibmvscsi_tgt.o +
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c new file +4184 -0
2,929 lines not on this page · raw message
drivers/scsi/ibmvscsi/ibmvscsi_tgt.h new file +347 -0
347 lines not on this page · raw message
drivers/scsi/ibmvscsi/libsrp.c new file +427 -0
427 lines not on this page · raw message
drivers/scsi/ibmvscsi/libsrp.h new file +123 -0
123 lines not on this page · raw message
drivers/scsi/libsrp.c deleted +0 -447
447 lines not on this page · raw message
include/scsi/libsrp.h deleted +0 -78
78 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.5.4 (Apple Git-61)
Part of the diff is not shown here. View the raw message.
Quoted 9 lines · Bryant G. Ly
drivers/scsi/Kconfig | 27 +- drivers/scsi/Makefile | 2 +- drivers/scsi/ibmvscsi/Makefile | 4 + drivers/scsi/ibmvscsi/ibmvscsi_tgt.c | 4184 ++++++++++++++++++++++++++++++++++ drivers/scsi/ibmvscsi/ibmvscsi_tgt.h | 347 +++ drivers/scsi/ibmvscsi/libsrp.c | 427 ++++ drivers/scsi/ibmvscsi/libsrp.h | 123 + drivers/scsi/libsrp.c | 447 ---- include/scsi/libsrp.h | 78 -
Sorry that I hadn't noticed this before but since no code is shared between the IBM vSCSI initiator and target drivers please consider moving the ibmvscsi_tgt.[ch] and libsrp.[ch] source files into a new directory. This will keep initiator and target drivers are in separate directories. This is the approach used for other upstream protocol drivers for which no code is shared between initiator and target drivers (e.g. the iSER, SRP initiator and target drivers).
Quoted 1 line
+#include <
linux/kthread.h>
Does this driver create kernel threads? Is inclusion of this header file needed?
Quoted 1 line
+#include <
linux/version.h>
We do not want #if LINUX_VERSION_CODE < KERNEL_VERSION(...) statements in upstream code so please leave this #include and the version tests out.
Quoted 33 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c new file +33
-0+/** +* ibmvscsis_modify_std_inquiry() - Modify STD Inquiry +* +* This function modifies the inquiry data prior to sending to initiator +* so that we can support current AIX. Internally we are going to +* add new ODM entries to support the emulation from LIO. This function +* is temporary until those changes are done. +*/ +static void ibmvscsis_modify_std_inquiry (struct se_cmd *se_cmd) +{ +struct se_device *dev = se_cmd->se_dev; +u32 cmd_len = se_cmd->data_length; +u32 repl_len; +unsigned char *buf =NULL ; + +if (cmd_len <=8 ) +return ; + + buf =transport_kmap_data_sg (se_cmd); +if (buf) { + repl_len =8 ; +if (cmd_len -8 < repl_len) + repl_len = cmd_len -8 ; +memcpy (&buf[8 ],"IBM " , repl_len); + +if (cmd_len >16 ) { + repl_len =16 ; +if (cmd_len -16 < repl_len) + repl_len = cmd_len -16 ; +if (dev->transport->get_device_type (dev) ==TYPE_ROM ) +memcpy (&buf[16 ],"VOPTA " , repl_len); +else +memcpy (&buf[16 ],"3303 NVDISK" , repl_len);
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c line 2437
Quoted 10 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c new file +10
-0+ } +if (cmd_len >32 ) { + repl_len =4 ; +if (cmd_len -32 < repl_len) + repl_len = cmd_len -32 ; +memcpy (&buf[32 ],"0001" , repl_len); + } +transport_kunmap_data_sg (se_cmd); + } +}
Christoph Hellwig had asked you *not* to modify the INQUIRY response generated by the target core. Had you noticed that comment?
Thanks,
Bart.
Quoted 11 lines · Bart Van Assche
Quoted 9 lines · Bryant G. Ly
drivers/scsi/Kconfig | 27 +- drivers/scsi/Makefile | 2 +- drivers/scsi/ibmvscsi/Makefile | 4 + drivers/scsi/ibmvscsi/ibmvscsi_tgt.c | 4184 ++++++++++++++++++++++++++++++++++ drivers/scsi/ibmvscsi/ibmvscsi_tgt.h | 347 +++ drivers/scsi/ibmvscsi/libsrp.c | 427 ++++ drivers/scsi/ibmvscsi/libsrp.h | 123 + drivers/scsi/libsrp.c | 447 ---- include/scsi/libsrp.h | 78 -
Quoted 7 lines
Sorry that I hadn't noticed this before but since no code is shared between the IBM vSCSI initiator and target drivers please consider moving the ibmvscsi_tgt.[ch] and libsrp.[ch] source files into a new directory. This will keep initiator and target drivers are in separate directories. This is the approach used for other upstream protocol drivers for which no code is shared between initiator and target drivers (e.g. the iSER, SRP initiator and target drivers).
Yeah, if no code is shared, and will ever be shared, we might as well merge libsrc.[c,h] directly into ibmvscsi_tgt.[c,h].
Quoted 38 lines
Quoted 38 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c new file +38
-0+/** +* ibmvscsis_modify_std_inquiry() - Modify STD Inquiry +* +* This function modifies the inquiry data prior to sending to initiator +* so that we can support current AIX. Internally we are going to +* add new ODM entries to support the emulation from LIO. This function +* is temporary until those changes are done. +*/ +static void ibmvscsis_modify_std_inquiry (struct se_cmd *se_cmd) +{ +struct se_device *dev = se_cmd->se_dev; +u32 cmd_len = se_cmd->data_length; +u32 repl_len; +unsigned char *buf =NULL ; + +if (cmd_len <=8 ) +return ; + + buf =transport_kmap_data_sg (se_cmd); +if (buf) { + repl_len =8 ; +if (cmd_len -8 < repl_len) + repl_len = cmd_len -8 ; +memcpy (&buf[8 ],"IBM " , repl_len); + +if (cmd_len >16 ) { + repl_len =16 ; +if (cmd_len -16 < repl_len) + repl_len = cmd_len -16 ; +if (dev->transport->get_device_type (dev) ==TYPE_ROM ) +memcpy (&buf[16 ],"VOPTA " , repl_len); +else +memcpy (&buf[16 ],"3303 NVDISK" , repl_len); + } +if (cmd_len >32 ) { + repl_len =4 ; +if (cmd_len -32 < repl_len) + repl_len = cmd_len -32 ;
Quoted 9 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c line 2437
Quoted 5 lines
drivers/scsi/ibmvscsi/ibmvscsi_tgt.c new file +5
-0+memcpy (&buf[32 ],"0001" , repl_len); + } +transport_kunmap_data_sg (se_cmd); + } +}Christoph Hellwig had asked you *not* to modify the INQUIRY response generated by the target core. Had you noticed that comment?
Yeah, so I wanted to avoid having to add a new target_core_fabric_ops API caller just for this special case, but there might not be another choice..
Previously, ibmvscsi-tgt was simply picking off INQUIRY and doing completion, setting the special payload buffer contents without actually submitting to target-core.
I'd probably still prefer the original method to avoid the extra target_core_fabric_ops API caller that will never be used by anybody else, unless there are issues with AIX ordered tasks wrt INQUIRY not actually making it into target-core.
Quoted 3 lines · Bryant G. Ly
This driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119
What kernel version is this patch based on? It doesn't apply cleanly on top of kernel v4.7-rc1 nor on top of kernel v4.6.
Thanks,
Bart.
Quoted 49 lines · Nicholas A. Bellinger
Quoted 39 lines · Bart Van Assche
Quoted 38 lines · Bryant G. Ly
(quoted diff) +38
-0+/** + * ibmvscsis_modify_std_inquiry() - Modify STD Inquiry + * + * This function modifies the inquiry data prior to sending to initiator + * so that we can support current AIX. Internally we are going to + * add new ODM entries to support the emulation from LIO. This function + * is temporary until those changes are done. + */ +static void ibmvscsis_modify_std_inquiry(struct se_cmd *se_cmd) +{ + struct se_device *dev = se_cmd->se_dev; + u32 cmd_len = se_cmd->data_length; + u32 repl_len; + unsigned char *buf = NULL; + + if (cmd_len <= 8) + return; + + buf = transport_kmap_data_sg(se_cmd); + if (buf) { + repl_len = 8; + if (cmd_len - 8 < repl_len) + repl_len = cmd_len - 8; + memcpy(&buf[8], "IBM ", repl_len); + + if (cmd_len > 16) { + repl_len = 16; + if (cmd_len - 16 < repl_len) + repl_len = cmd_len - 16; + if (dev->transport->get_device_type(dev) == TYPE_ROM) + memcpy(&buf[16], "VOPTA ", repl_len); + else + memcpy(&buf[16], "3303 NVDISK", repl_len); + } + if (cmd_len > 32) { + repl_len = 4; + if (cmd_len - 32 < repl_len) + repl_len = cmd_len - 32;Quoted 8 lines
Review
Quoted 5 lines
(quoted diff) +5
-0+ memcpy(&buf[32], "0001", repl_len); + } + transport_kunmap_data_sg(se_cmd); + } +}Christoph Hellwig had asked you *not* to modify the INQUIRY response generated by the target core. Had you noticed that comment?
Quoted 3 lines
Yeah, so I wanted to avoid having to add a new
target_core_fabric_opsAPI caller just for this special case, but there might not be another choice..
All what's needed is something like the (untested) patch below. As one can see no new function pointers have been added to target_core_fabric_ops. All that has been added are a few new data members. With the patch below ibmvscsis_modify_std_inquiry() can be left out and the target core will pick up the "IBM", "VOPTA", "3303 NVDISK" and "0001" strings through the target_core_fabric_ops instance in the ibmvscsis template. I think this is a much cleaner approach than keeping the ibmvscsis_modify_std_inquiry() function ...
Bart.
[PATCH] target: Make INQUIRY vendor, product ID and product revision configurable
--- drivers/target/target_core_configfs.c | 4 ++++ drivers/target/target_core_spc.c | 22 +++++++++++++++++----- include/target/target_core_fabric.h | 6 ++++++ 3 files changed, 27 insertions(+), 5 deletions(-)
drivers/target/target_core_configfs.c +4 -0
@@ -442,6 +442,10 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo)pr_err ("Missing tfo->fabric_drop_tpg()\n" );return -EINVAL ; } +if (tfo->prod_id_cnt && !tfo->prod_id) { +pr_err ("Missing tfo->prod_id\n" ); +return -EINVAL ; + }return 0 ; }
drivers/target/target_core_spc.c +17 -5
@@ -66,6 +66,9 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)struct se_lun *lun = cmd->se_lun;struct se_device *dev = cmd->se_dev;struct se_session *sess = cmd->se_sess; +struct se_portal_group *tpg = lun->lun_tpg; +const struct target_core_fabric_ops *tfo = tpg->se_tpg_tfo; +const char *vendor, *prod_id, *prod_rev;/* Set RMB (removable media) for tape devices */ if (dev->transport->get_device_type (dev) ==TYPE_TAPE )
@@ -108,12 +111,21 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf) buf[7 ] =0x2 ;/* CmdQue=1 */ -memcpy (&buf[8 ],"LIO-ORG " ,8 ); + vendor = tfo->t10_vend_id ? :"LIO-ORG" ; +memset (&buf[8 ],0x20 ,8 ); +memcpy (&buf[8 ], vendor,min_t (int,strlen (vendor),8 )); + prod_id = dev->t10_wwn.model; +if (tfo->prod_id) { +int dev_type = dev->transport->get_device_type (dev); + +if (dev_type < tfo->prod_id_cnt && tfo->prod_id[dev_type]) + prod_id = tfo->prod_id[dev_type]; + }memset (&buf[16 ],0x20 ,16 ); -memcpy (&buf[16 ], dev->t10_wwn.model, -min_t (size_t,strlen (dev->t10_wwn.model),16 )); -memcpy (&buf[32 ], dev->t10_wwn.revision, -min_t (size_t,strlen (dev->t10_wwn.revision),4 )); +memcpy (&buf[16 ], prod_id,min_t (size_t,strlen (prod_id),16 )); + prod_rev = tfo->prod_rev ? : dev->t10_wwn.revision; +memset (&buf[32 ],0x20 ,4 ); +memcpy (&buf[32 ], prod_rev,min_t (size_t,strlen (prod_rev),4 )); buf[4 ] =31 ;/* Set additional length to 31 */ return 0 ;
include/target/target_core_fabric.h +6 -0
@@ -85,6 +85,12 @@ struct target_core_fabric_ops {void (*fabric_drop_np)(struct se_tpg_np *);int (*fabric_init_nodeacl)(struct se_node_acl *,const char *); +/* For spc_emulate_inquiry_std() */ +const char *t10_vend_id; +int prod_id_cnt;/* Number of elements in the prod_id array */ +const char **prod_id; +const char *prod_rev; +struct configfs_attribute **tfc_discovery_attrs;struct configfs_attribute **tfc_wwn_attrs;struct configfs_attribute **tfc_tpg_base_attrs;
Quoted 8 lines · Bart Van Assche
All what's needed is something like the (untested) patch below. As one can see no new function pointers have been added to
target_core_fabric_ops. All that has been added are a few new data members. With the patch belowibmvscsis_modify_std_inquiry()can be left out and the target core will pick up the "IBM", "VOPTA", "3303 NVDISK" and "0001" strings through thetarget_core_fabric_opsinstance in the ibmvscsis template. I think this is a much cleaner approach than keeping theibmvscsis_modify_std_inquiry()function ...
If we really have to, yes. But then again we manually allow overriding the values from configfs, and none of this seems to be a protocol requirement but just a workaround for a braindead AIX initiator. So the right thing is documentation telling people how to modify their inquiry strings for AIX to work.
PATCH v5 1/1 ibmvscsis: Initial commit of IBM VSCSI Tgt Driver
This driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119
The driver provides a virtual SCSI device on IBM Power Servers.
This patch contains the fifth version for an initial merge of the tcm ibmvscsis driver. More information on this driver and config can be found:
https://github.com/powervm/ibmvscsis/wiki/Configuration
http://www.linux-iscsi.org/wiki/IBM_vSCSI
---
Version 5:
- changed to use scsilun_to_int
- removed inquiry modification
- changed to use target_alloc_session
- removed shutdown_session, etc
Version 4:
- Changed some print statements to dev_err.
-Also changed to use target_alloc_session instead of manually coding it.
- Removed scsi_cmnd and scsi_host bits removed from libsrp to completely
- Stripped out un-needed includes.
- Added pre-allocation of commands before IO starts.
- Added Support for Transport event, fast-fail support, MESSAGE_IN_CRQ format
- Changed the way queues are handled for better performance, and state mgmt.
Version 3:
- Revert old libsrp and make it clear resurrection old vscsi target driver
- Made libsrp a linked file to the ibmvscsis module
Version 2:
-Fixed comments from Bart/Joe in regards to styling and code structure
Version 1:
This initial commit contains WIP of the IBM VSCSI Target Fabric Module. It currently supports read/writes, and I have tested the ability to create a file backstore with the driver, install RHEL, and then boot up the partition via filio backstore through the driver.
MAINTAINERS | 11 + drivers/scsi/Kconfig | 27 +- drivers/scsi/Makefile | 2 +- drivers/scsi/ibmvscsi/Makefile | 4 + drivers/scsi/ibmvscsi/ibmvfc.h | 2 +- drivers/scsi/ibmvscsi/ibmvscsi.h | 2 +- drivers/scsi/ibmvscsi/viosrp.h | 225 -- drivers/scsi/ibmvscsi_tgt/Makefile | 4 + drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 4029 ++++++++++++++++++++++++++++++ drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 342 +++ drivers/scsi/ibmvscsi_tgt/libsrp.c | 427 ++++ drivers/scsi/ibmvscsi_tgt/libsrp.h | 123 + drivers/scsi/libsrp.c | 447 ---- include/scsi/libsrp.h | 78 - include/scsi/viosrp.h | 220 ++ 15 files changed, 5180 insertions(+), 763 deletions(-) delete mode 100644 drivers/scsi/ibmvscsi/viosrp.h create mode 100644 drivers/scsi/ibmvscsi_tgt/Makefile create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.c create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.h delete mode 100644 drivers/scsi/libsrp.c delete mode 100644 include/scsi/libsrp.h create mode 100644 include/scsi/viosrp.h
MAINTAINERS +11 -0
@@ -5451,6 +5451,17 @@ S: Supported F: drivers/scsi/ibmvscsi/ibmvscsi* F: drivers/scsi/ibmvscsi/viosrp.h +IBM Power Virtual SCSI Device Target Driver +M: Bryant G. Ly <[email protected]> +M: Michael Cyr <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: drivers/scsi/ibmvscsi/ibmvscsis.c +F: drivers/scsi/ibmvscsi/ibmvscsis.h +F: drivers/scsi/ibmvscsi/libsrp.c +F: drivers/scsi/ibmvscsi/libsrp.h + IBM Power Virtual FC Device Drivers M: Tyrel Datwyler <[email protected]> L: [email protected]
drivers/scsi/Kconfig +17 -10
@@ -848,6 +848,23 @@ config SCSI_IBMVSCSI To compile this driver as a module, choose M here: the module will be called ibmvscsi. +config SCSI_IBMVSCSIS + tristate "IBM Virtual SCSI Server support" + depends on PPC_PSERIES && TARGET_CORE && SCSI && PCI + help + This is the IBM POWER Virtual SCSI Target Server + This driver uses the SRP protocol for communication betwen servers + guest and/or the host that run on the same server. + More information on VSCSI protocol can be found at www.power.org + + The userspace configuration needed to initialize the driver can be + be found here: + + https://github.com/powervm/ibmvscsis/wiki/Configuration + + To compile this driver as a module, choose M here: the + module will be called ibmvstgt. + config SCSI_IBMVFC tristate "IBM Virtual FC support" depends on PPC_PSERIES && SCSI
@@ -1729,16 +1746,6 @@ config SCSI_PM8001 This driver supports PMC-Sierra PCIE SAS/SATA 8x6G SPC 8001 chip based host adapters. -config SCSI_SRP - tristate "SCSI RDMA Protocol helper library" - depends on SCSI && PCI - select SCSI_TGT - help - If you wish to use SRP target drivers, say Y. - - To compile this driver as a module, choose M here: the - module will be called libsrp. - config SCSI_BFA_FC tristate "Brocade BFA Fibre Channel Support" depends on PCI && SCSI
drivers/scsi/Makefile +1 -1
@@ -127,8 +127,8 @@ obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o obj-$(CONFIG_SCSI_SNI_53C710) += 53c700.o sni_53c710.o obj-$(CONFIG_SCSI_NSP32) += nsp32.o obj-$(CONFIG_SCSI_IPR) += ipr.o -obj-$(CONFIG_SCSI_SRP) += libsrp.o obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsi_tgt/ obj-$(CONFIG_SCSI_IBMVFC) += ibmvscsi/ obj-$(CONFIG_SCSI_HPTIOP) += hptiop.o obj-$(CONFIG_SCSI_STEX) += stex.o
drivers/scsi/ibmvscsi/Makefile +4 -0
@@ -1,2 +1,6 @@ obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi.o +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o obj-$(CONFIG_SCSI_IBMVFC) += ibmvfc.o + +ibmvscsis-objs := libsrp.o ibmvscsi_tgt.o +
drivers/scsi/ibmvscsi/ibmvfc.h +1 -1
@@ -26,7 +26,7 @@#include <linux/list.h> #include <linux/types.h> -#include "viosrp.h" +#include <scsi/viosrp.h> #define IBMVFC_NAME "ibmvfc"#define IBMVFC_DRIVER_VERSION "1.0.11"
drivers/scsi/ibmvscsi/ibmvscsi.h +1 -1
@@ -33,7 +33,7 @@#include <linux/list.h> #include <linux/completion.h> #include <linux/interrupt.h> -#include "viosrp.h" +#include <scsi/viosrp.h> struct scsi_cmnd ;struct Scsi_Host ;
drivers/scsi/ibmvscsi/viosrp.h deleted +0 -225
225 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o + +ibmvscsis-objs := libsrp.o ibmvscsi_tgt.o +
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c new file +4029 -0
2,684 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h new file +342 -0
342 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/libsrp.c new file +427 -0
427 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/libsrp.h new file +123 -0
123 lines not on this page · raw message
drivers/scsi/libsrp.c deleted +0 -447
447 lines not on this page · raw message
include/scsi/libsrp.h deleted +0 -78
78 lines not on this page · raw message
include/scsi/viosrp.h new file +220 -0
220 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.5.4 (Apple Git-61)
Part of the diff is not shown here. View the raw message.
Quoted 8 lines · Bart Van Assche
Quoted 3 lines · Bryant G. Ly
This driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119What kernel version is this patch based on? It doesn't apply cleanly on top of kernel v4.7-rc1 nor on top of kernel v4.6.
It should be for 4.5, but latest version I based it off 4.6 stable. So you should look at that one.
-Bryant
Quoted 137 lines · Bart Van Assche
Quoted 49 lines · Nicholas A. Bellinger
Quoted 39 lines · Bart Van Assche
Quoted 38 lines · Bryant G. Ly
(quoted diff) +38
-0+/** + * ibmvscsis_modify_std_inquiry() - Modify STD Inquiry + * + * This function modifies the inquiry data prior to sending to initiator + * so that we can support current AIX. Internally we are going to + * add new ODM entries to support the emulation from LIO. This function + * is temporary until those changes are done. + */ +static void ibmvscsis_modify_std_inquiry(struct se_cmd *se_cmd) +{ + struct se_device *dev = se_cmd->se_dev; + u32 cmd_len = se_cmd->data_length; + u32 repl_len; + unsigned char *buf = NULL; + + if (cmd_len <= 8) + return; + + buf = transport_kmap_data_sg(se_cmd); + if (buf) { + repl_len = 8; + if (cmd_len - 8 < repl_len) + repl_len = cmd_len - 8; + memcpy(&buf[8], "IBM ", repl_len); + + if (cmd_len > 16) { + repl_len = 16; + if (cmd_len - 16 < repl_len) + repl_len = cmd_len - 16; + if (dev->transport->get_device_type(dev) == TYPE_ROM) + memcpy(&buf[16], "VOPTA ", repl_len); + else + memcpy(&buf[16], "3303 NVDISK", repl_len); + } + if (cmd_len > 32) { + repl_len = 4; + if (cmd_len - 32 < repl_len) + repl_len = cmd_len - 32;Quoted 8 lines
Review
Quoted 5 lines
(quoted diff) +5
-0+ memcpy(&buf[32], "0001", repl_len); + } + transport_kunmap_data_sg(se_cmd); + } +}Christoph Hellwig had asked you *not* to modify the INQUIRY response generated by the target core. Had you noticed that comment?
Quoted 3 lines
Yeah, so I wanted to avoid having to add a new
target_core_fabric_opsAPI caller just for this special case, but there might not be another choice..All what's needed is something like the (untested) patch below. As one can see no new function pointers have been added to
target_core_fabric_ops. All that has been added are a few new data members. With the patch belowibmvscsis_modify_std_inquiry()can be left out and the target core will pick up the "IBM", "VOPTA", "3303 NVDISK" and "0001" strings through thetarget_core_fabric_opsinstance in the ibmvscsis template. I think this is a much cleaner approach than keeping theibmvscsis_modify_std_inquiry()function ...Bart.
[PATCH] target: Make INQUIRY vendor, product ID and product revision configurable
---
drivers/target/target_core_configfs.c | 4 ++++ drivers/target/target_core_spc.c | 22 +++++++++++++++++----- include/target/target_core_fabric.h | 6 ++++++ 3 files changed, 27 insertions(+), 5 deletions(-)drivers/target/target_core_configfs.c +4
-0@@ -442,6 +442,10 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo)pr_err ("Missing tfo->fabric_drop_tpg()\n" );return -EINVAL ; } +if (tfo->prod_id_cnt && !tfo->prod_id) { +pr_err ("Missing tfo->prod_id\n" ); +return -EINVAL ; + }return 0 ; }drivers/target/target_core_spc.c +17
-5@@ -66,6 +66,9 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)struct se_lun *lun = cmd->se_lun;struct se_device *dev = cmd->se_dev;struct se_session *sess = cmd->se_sess; +struct se_portal_group *tpg = lun->lun_tpg; +const struct target_core_fabric_ops *tfo = tpg->se_tpg_tfo; +const char *vendor, *prod_id, *prod_rev;/* Set RMB (removable media) for tape devices */ if (dev->transport->get_device_type (dev) ==TYPE_TAPE )@@ -108,12 +111,21 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf) buf[7 ] =0x2 ;/* CmdQue=1 */ -memcpy (&buf[8 ],"LIO-ORG " ,8 ); + vendor = tfo->t10_vend_id ? :"LIO-ORG" ; +memset (&buf[8 ],0x20 ,8 ); +memcpy (&buf[8 ], vendor,min_t (int,strlen (vendor),8 )); + prod_id = dev->t10_wwn.model; +if (tfo->prod_id) { +int dev_type = dev->transport->get_device_type (dev); + +if (dev_type < tfo->prod_id_cnt && tfo->prod_id[dev_type]) + prod_id = tfo->prod_id[dev_type]; + }memset (&buf[16 ],0x20 ,16 ); -memcpy (&buf[16 ], dev->t10_wwn.model, -min_t (size_t,strlen (dev->t10_wwn.model),16 )); -memcpy (&buf[32 ], dev->t10_wwn.revision, -min_t (size_t,strlen (dev->t10_wwn.revision),4 )); +memcpy (&buf[16 ], prod_id,min_t (size_t,strlen (prod_id),16 )); + prod_rev = tfo->prod_rev ? : dev->t10_wwn.revision; +memset (&buf[32 ],0x20 ,4 ); +memcpy (&buf[32 ], prod_rev,min_t (size_t,strlen (prod_rev),4 )); buf[4 ] =31 ;/* Set additional length to 31 */ return 0 ;include/target/target_core_fabric.h +0
-0@@ -85,6 +85,12 @@ struct target_core_fabric_ops {void (*fabric_drop_np)(struct se_tpg_np *);int (*fabric_init_nodeacl)(struct se_node_acl *,const char *);
include/target/target_core_fabric.h struct target_core_fabric_ops { · line 96
Quoted 10 lines
include/target/target_core_fabric.h +6
-0+/* For spc_emulate_inquiry_std() */ +const char *t10_vend_id; +int prod_id_cnt;/* Number of elements in the prod_id array */ +const char **prod_id; +const char *prod_rev; +struct configfs_attribute **tfc_discovery_attrs;struct configfs_attribute **tfc_wwn_attrs;struct configfs_attribute **tfc_tpg_base_attrs;
This worked great btw, thanks for helping out!
-Bryant
Quoted 10 lines · Christoph Hellwig
Quoted 8 lines · Bart Van Assche
All what's needed is something like the (untested) patch below. As one can see no new function pointers have been added to
target_core_fabric_ops. All that has been added are a few new data members. With the patch belowibmvscsis_modify_std_inquiry()can be left out and the target core will pick up the "IBM", "VOPTA", "3303 NVDISK" and "0001" strings through thetarget_core_fabric_opsinstance in the ibmvscsis template. I think this is a much cleaner approach than keeping theibmvscsis_modify_std_inquiry()function ...
Quoted 6 lines
If we really have to, yes. But then again we manually allow overriding the values from configfs, and none of this seems to be a protocol requirement but just a workaround for a braindead AIX initiator. So the right thing is documentation telling people how to modify their inquiry strings for AIX to work.
I can add documentation for modifying their inquiry strings, but the thing is This is just to support older AIX clients who don’t want to update. We already Have a working ODM patch to address this but we’d still like to support older Customers who would like to use this driver with an AIX initiator(client).
Latest patch I have stripped everything out as per your request, which Does work with a linux client.
-Bryant
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 1 line · Bryant G. Ly
The driver provides a virtual SCSI device on IBM Power Servers.
[]
MAINTAINERS
Quoted 27 lines
MAINTAINERS | 11 + drivers/scsi/Kconfig | 27 +- drivers/scsi/Makefile | 2 +- drivers/scsi/ibmvscsi/Makefile | 4 + drivers/scsi/ibmvscsi/ibmvfc.h | 2 +- drivers/scsi/ibmvscsi/ibmvscsi.h | 2 +- drivers/scsi/ibmvscsi/viosrp.h | 225 -- drivers/scsi/ibmvscsi_tgt/Makefile | 4 +
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c| 4029 ++++++++++++++++++++++++++++++drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h| 342 +++ drivers/scsi/ibmvscsi_tgt/libsrp.c | 427 ++++ drivers/scsi/ibmvscsi_tgt/libsrp.h | 123 +drivers/scsi/libsrp.c | 447 ---- include/scsi/libsrp.h | 78 - include/scsi/viosrp.h | 220 ++ 15 files changed, 5180 insertions(+), 763 deletions(-)delete mode 100644
drivers/scsi/ibmvscsi/viosrp.hcreate mode 100644drivers/scsi/ibmvscsi_tgt/Makefilecreate mode 100644drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.ccreate mode 100644drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.hcreate mode 100644drivers/scsi/ibmvscsi_tgt/libsrp.ccreate mode 100644drivers/scsi/ibmvscsi_tgt/libsrp.hdelete mode 100644drivers/scsi/libsrp.c
delete mode 100644include/scsi/libsrp.h
create mode 100644include/scsi/viosrp.hMAINTAINERS +0
-0
[]
Quoted 4 lines
MAINTAINERS +0
-0@@ -5451,6 +5451,17 @@ S: SupportedF:
drivers/scsi/ibmvscsi/ibmvscsi*
F:drivers/scsi/ibmvscsi/viosrp.h
MAINTAINERS S: Supported · line 5463
Quoted 10 lines
MAINTAINERS +10
-0+IBM Power Virtual SCSI Device Target Driver +M: Bryant G. Ly <[email protected]> +M: Michael Cyr <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: drivers/scsi/ibmvscsi/ibmvscsis.c +F: drivers/scsi/ibmvscsi/ibmvscsis.h +F: drivers/scsi/ibmvscsi/libsrp.c +F: drivers/scsi/ibmvscsi/libsrp.h
trivia:
Please make the MAINTAINER pattern entries match the file locations.
This could be done in a separate patch if this doesn't need to be resubmitted for any other reason.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v6 1/1 ibmvscsis: Initial commit of IBM VSCSI Tgt Driver
In reply to Bryant G. LyThis driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119
The driver provides a virtual SCSI device on IBM Power Servers.
This patch contains the fifth version for an initial merge of the tcm ibmvscsis driver. More information on this driver and config can be found:
https://github.com/powervm/ibmvscsis/wiki/Configuration
http://www.linux-iscsi.org/wiki/IBM_vSCSI
---
Version 6:
- Removed modification of report luns
- fixed Maintainers file
- removed #include <target/target_core_backend.h>
Version 5:
- changed to use scsilun_to_int
- removed inquiry modification
- changed to use target_alloc_session
- removed shutdown_session, etc
Version 4:
- Changed some print statements to dev_err.
-Also changed to use target_alloc_session instead of manually coding it.
- Removed scsi_cmnd and scsi_host bits removed from libsrp to completely
- Stripped out un-needed includes.
- Added pre-allocation of commands before IO starts.
- Added Support for Transport event, fast-fail support, MESSAGE_IN_CRQ format
- Changed the way queues are handled for better performance, and state mgmt.
Version 3:
- Revert old libsrp and make it clear resurrection old vscsi target driver
- Made libsrp a linked file to the ibmvscsis module
Version 2:
-Fixed comments from Bart/Joe in regards to styling and code structure
MAINTAINERS | 13 +- drivers/scsi/Kconfig | 27 +- drivers/scsi/Makefile | 2 +- drivers/scsi/ibmvscsi/Makefile | 4 + drivers/scsi/ibmvscsi/ibmvfc.h | 2 +- drivers/scsi/ibmvscsi/ibmvscsi.h | 2 +- drivers/scsi/ibmvscsi/viosrp.h | 225 -- drivers/scsi/ibmvscsi_tgt/Makefile | 4 + drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3985 ++++++++++++++++++++++++++++++ drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 342 +++ drivers/scsi/ibmvscsi_tgt/libsrp.c | 427 ++++ drivers/scsi/ibmvscsi_tgt/libsrp.h | 123 + drivers/scsi/libsrp.c | 447 ---- include/scsi/libsrp.h | 78 - include/scsi/viosrp.h | 220 ++ 15 files changed, 5137 insertions(+), 764 deletions(-) delete mode 100644 drivers/scsi/ibmvscsi/viosrp.h create mode 100644 drivers/scsi/ibmvscsi_tgt/Makefile create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.c create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.h delete mode 100644 drivers/scsi/libsrp.c delete mode 100644 include/scsi/libsrp.h create mode 100644 include/scsi/viosrp.h
MAINTAINERS +12 -1
@@ -5449,7 +5449,18 @@ M: Tyrel Datwyler <[email protected]> L: [email protected] S: Supported F: drivers/scsi/ibmvscsi/ibmvscsi* -F: drivers/scsi/ibmvscsi/viosrp.h +F: include/scsi/viosrp.h + +IBM Power Virtual SCSI Device Target Driver +M: Bryant G. Ly <[email protected]> +M: Michael Cyr <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +F: drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h +F: drivers/scsi/ibmvscsi_tgt/libsrp.c +F: drivers/scsi/ibmvscsi_tgt/libsrp.h IBM Power Virtual FC Device Drivers M: Tyrel Datwyler <[email protected]>
drivers/scsi/Kconfig +17 -10
@@ -848,6 +848,23 @@ config SCSI_IBMVSCSI To compile this driver as a module, choose M here: the module will be called ibmvscsi. +config SCSI_IBMVSCSIS + tristate "IBM Virtual SCSI Server support" + depends on PPC_PSERIES && TARGET_CORE && SCSI && PCI + help + This is the IBM POWER Virtual SCSI Target Server + This driver uses the SRP protocol for communication betwen servers + guest and/or the host that run on the same server. + More information on VSCSI protocol can be found at www.power.org + + The userspace configuration needed to initialize the driver can be + be found here: + + https://github.com/powervm/ibmvscsis/wiki/Configuration + + To compile this driver as a module, choose M here: the + module will be called ibmvstgt. + config SCSI_IBMVFC tristate "IBM Virtual FC support" depends on PPC_PSERIES && SCSI
@@ -1729,16 +1746,6 @@ config SCSI_PM8001 This driver supports PMC-Sierra PCIE SAS/SATA 8x6G SPC 8001 chip based host adapters. -config SCSI_SRP - tristate "SCSI RDMA Protocol helper library" - depends on SCSI && PCI - select SCSI_TGT - help - If you wish to use SRP target drivers, say Y. - - To compile this driver as a module, choose M here: the - module will be called libsrp. - config SCSI_BFA_FC tristate "Brocade BFA Fibre Channel Support" depends on PCI && SCSI
drivers/scsi/Makefile +1 -1
@@ -127,8 +127,8 @@ obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o obj-$(CONFIG_SCSI_SNI_53C710) += 53c700.o sni_53c710.o obj-$(CONFIG_SCSI_NSP32) += nsp32.o obj-$(CONFIG_SCSI_IPR) += ipr.o -obj-$(CONFIG_SCSI_SRP) += libsrp.o obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsi_tgt/ obj-$(CONFIG_SCSI_IBMVFC) += ibmvscsi/ obj-$(CONFIG_SCSI_HPTIOP) += hptiop.o obj-$(CONFIG_SCSI_STEX) += stex.o
drivers/scsi/ibmvscsi/Makefile +4 -0
@@ -1,2 +1,6 @@ obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi.o +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o obj-$(CONFIG_SCSI_IBMVFC) += ibmvfc.o + +ibmvscsis-objs := libsrp.o ibmvscsi_tgt.o +
drivers/scsi/ibmvscsi/ibmvfc.h +1 -1
@@ -26,7 +26,7 @@#include <linux/list.h> #include <linux/types.h> -#include "viosrp.h" +#include <scsi/viosrp.h> #define IBMVFC_NAME "ibmvfc"#define IBMVFC_DRIVER_VERSION "1.0.11"
drivers/scsi/ibmvscsi/ibmvscsi.h +1 -1
@@ -33,7 +33,7 @@#include <linux/list.h> #include <linux/completion.h> #include <linux/interrupt.h> -#include "viosrp.h" +#include <scsi/viosrp.h> struct scsi_cmnd ;struct Scsi_Host ;
drivers/scsi/ibmvscsi/viosrp.h deleted +0 -225
225 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o + +ibmvscsis-objs := libsrp.o ibmvscsi_tgt.o +
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c new file +3985 -0
2,682 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h new file +342 -0
342 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/libsrp.c new file +427 -0
427 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/libsrp.h new file +123 -0
123 lines not on this page · raw message
drivers/scsi/libsrp.c deleted +0 -447
447 lines not on this page · raw message
include/scsi/libsrp.h deleted +0 -78
78 lines not on this page · raw message
include/scsi/viosrp.h new file +220 -0
220 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.5.4 (Apple Git-61)
Part of the diff is not shown here. View the raw message.
Quoted 3 lines · Bryant G. Ly
This driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119
(style trivia only, nothing important enough to force a respin but nice to fix one day)
Please use git format-patch -M so file renames are more obvious.
MAINTAINERS
Quoted 1 line
MAINTAINERS +0
-0
[]
MAINTAINERS M: Tyrel Datwyler <[email protected]> · line 5460
Quoted 7 lines
MAINTAINERS +7
-0+IBM Power Virtual SCSI Device Target Driver +M: Bryant G. Ly <[email protected]> +M: Michael Cyr <[email protected]> +L: [email protected] +L: [email protected] +S: Supportedybe +F: drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
Maybe
F: drivers/scsi/ibmscsi_tgt/
MAINTAINERS M: Tyrel Datwyler <[email protected]> · line 5463
Quoted 3 lines
MAINTAINERS +3
-0+F: drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h +F: drivers/scsi/ibmvscsi_tgt/libsrp.c +F: drivers/scsi/ibmvscsi_tgt/libsrp.h
and these become unnecessary
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
Quoted 1 line
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +0
-0
[]
Quoted 3 lines
+/**
+ *ibmvscsis_establish_new_q()- Establish new CRQ queue
+ */
If you use kernel-doc comment style,
please describe the function arguments too.
Quoted 32 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +32
-0+static long ibmvscsis_establish_new_q(struct scsi_info *vscsi, uint new_state) +{ +long rc =ADAPT_SUCCESS ; +uint format; + + vscsi->flags &=PRESERVE_FLAG_FIELDS ; + vscsi->rsp_q_timer.timer_pops =0 ; + vscsi->debit =0 ; + vscsi->credit =0 ; + rc =vio_enable_interrupts (vscsi->dma_dev); +if (rc) { +pr_warn ("reset_queue: failed to enable interrupts, rc %ld\n" , + rc); + }else { + rc =ibmvscsis_check_init_msg (vscsi, &format); +if (rc) { +dev_err (&vscsi->dev,"reset_queue: check_init_msg failed, rc %ld\n" , + rc); + }else if (format ==UNUSED_FORMAT && + new_state == WAIT_CONNECTION) { + rc =ibmvscsis_send_init_message (vscsi,INIT_MSG ); +switch (rc) { +case H_SUCCESS : +case H_DROPPED : +case H_CLOSED : + rc =ADAPT_SUCCESS ; +break ; + +case H_PARAMETER : +case H_HARDWARE : +break ; +
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c line 422
Quoted 10 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +10
-0+default : + vscsi->state =UNDEFINED ; + rc =H_HARDWARE ; +break ; + } + } + } + +return rc; +}
This sort of code can have indent reduced by doing
rc = vio_enable_interrupts(...)
if (rc) {
pr_warn(...);
return rc;
}
rc = ibmvscsis_check_init_msg(...)
if (rc) {
dev_err(...);
return rc;
}
if (format == UNUSED_FORMAT && new_state == WAIT_CONNECTION) {
rc = ibmvscsis_send_init_message(vscsi, INIT_MSG);
switch (rc) {
etc...
}
}Why use pr_warn and dev_err in the same function? Shouldn't dev_<level> be used whenever a struct device is available?
Also it's nice to use %s, __func__ instead of directly embedding a function like name into the format string.
A lot of the pr_debug uses seem to be function tracing and could be eliminated altogether.
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
Quoted 2 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +2
-0+/* can transition from this state to UNCONFIGURING */ +case UNDEFINED :
Comment style for switch / case labels could not be indented but start at the same indent level as the case statement.
PATCH v7 1/1 ibmvscsis: Initial commit of IBM VSCSI Tgt Driver
In reply to Bryant G. LyThis driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119
The driver provides a virtual SCSI device on IBM Power Servers.
This patch contains the fifth version for an initial merge of the tcm ibmvscsis driver. More information on this driver and config can be found:
https://github.com/powervm/ibmvscsis/wiki/Configuration
http://www.linux-iscsi.org/wiki/IBM_vSCSI
---
Version 7:
- Removed old module from drivers/scsi/ibmvscsi/Makefile
- Fixed styling from Joe Perches comments.
Version 6:
- Removed modification of report luns
- fixed Maintainers file
- removed #include <target/target_core_backend.h>
Version 5:
- changed to use scsilun_to_int
- removed inquiry modification
- changed to use target_alloc_session
- removed shutdown_session, etc
Version 4:
- Changed some print statements to dev_err.
-Also changed to use target_alloc_session instead of manually coding it.
- Removed scsi_cmnd and scsi_host bits removed from libsrp to completely
- Stripped out un-needed includes.
- Added pre-allocation of commands before IO starts.
- Added Support for Transport event, fast-fail support, MESSAGE_IN_CRQ format
- Changed the way queues are handled for better performance, and state mgmt.
Version 3:
- Revert old libsrp and make it clear resurrection old vscsi target driver
- Made libsrp a linked file to the ibmvscsis module
Version 2:
-Fixed comments from Bart/Joe in regards to styling and code structure
MAINTAINERS | 10 +-
drivers/scsi/Kconfig | 27 +-
drivers/scsi/Makefile | 2 +-
drivers/scsi/ibmvscsi/ibmvfc.h | 2 +-
drivers/scsi/ibmvscsi/ibmvscsi.h | 2 +-
drivers/scsi/ibmvscsi_tgt/Makefile | 4 +
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3965 ++++++++++++++++++++++
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 342 ++
drivers/scsi/ibmvscsi_tgt/libsrp.c | 427 +++
drivers/scsi/ibmvscsi_tgt/libsrp.h | 123 +
drivers/scsi/libsrp.c | 447 ---
include/scsi/libsrp.h | 78 -
{drivers/scsi/ibmvscsi => include/scsi}/viosrp.h | 13 +-
13 files changed, 4894 insertions(+), 548 deletions(-)
create mode 100644 drivers/scsi/ibmvscsi_tgt/Makefile
create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h
create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.c
create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.h
delete mode 100644 drivers/scsi/libsrp.c
delete mode 100644 include/scsi/libsrp.h
rename {drivers/scsi/ibmvscsi => include/scsi}/viosrp.h (92%)MAINTAINERS +9 -1
@@ -5449,7 +5449,15 @@ M: Tyrel Datwyler <[email protected]> L: [email protected] S: Supported F: drivers/scsi/ibmvscsi/ibmvscsi* -F: drivers/scsi/ibmvscsi/viosrp.h +F: include/scsi/viosrp.h + +IBM Power Virtual SCSI Device Target Driver +M: Bryant G. Ly <[email protected]> +M: Michael Cyr <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: drivers/scsi/ibmvscsi_tgt/ IBM Power Virtual FC Device Drivers M: Tyrel Datwyler <[email protected]>
drivers/scsi/Kconfig +17 -10
@@ -848,6 +848,23 @@ config SCSI_IBMVSCSI To compile this driver as a module, choose M here: the module will be called ibmvscsi. +config SCSI_IBMVSCSIS + tristate "IBM Virtual SCSI Server support" + depends on PPC_PSERIES && TARGET_CORE && SCSI && PCI + help + This is the IBM POWER Virtual SCSI Target Server + This driver uses the SRP protocol for communication betwen servers + guest and/or the host that run on the same server. + More information on VSCSI protocol can be found at www.power.org + + The userspace configuration needed to initialize the driver can be + be found here: + + https://github.com/powervm/ibmvscsis/wiki/Configuration + + To compile this driver as a module, choose M here: the + module will be called ibmvstgt. + config SCSI_IBMVFC tristate "IBM Virtual FC support" depends on PPC_PSERIES && SCSI
@@ -1729,16 +1746,6 @@ config SCSI_PM8001 This driver supports PMC-Sierra PCIE SAS/SATA 8x6G SPC 8001 chip based host adapters. -config SCSI_SRP - tristate "SCSI RDMA Protocol helper library" - depends on SCSI && PCI - select SCSI_TGT - help - If you wish to use SRP target drivers, say Y. - - To compile this driver as a module, choose M here: the - module will be called libsrp. - config SCSI_BFA_FC tristate "Brocade BFA Fibre Channel Support" depends on PCI && SCSI
drivers/scsi/Makefile +1 -1
@@ -127,8 +127,8 @@ obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o obj-$(CONFIG_SCSI_SNI_53C710) += 53c700.o sni_53c710.o obj-$(CONFIG_SCSI_NSP32) += nsp32.o obj-$(CONFIG_SCSI_IPR) += ipr.o -obj-$(CONFIG_SCSI_SRP) += libsrp.o obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsi_tgt/ obj-$(CONFIG_SCSI_IBMVFC) += ibmvscsi/ obj-$(CONFIG_SCSI_HPTIOP) += hptiop.o obj-$(CONFIG_SCSI_STEX) += stex.o
drivers/scsi/ibmvscsi/ibmvfc.h +1 -1
@@ -26,7 +26,7 @@#include <linux/list.h> #include <linux/types.h> -#include "viosrp.h" +#include <scsi/viosrp.h> #define IBMVFC_NAME "ibmvfc"#define IBMVFC_DRIVER_VERSION "1.0.11"
drivers/scsi/ibmvscsi/ibmvscsi.h +1 -1
@@ -33,7 +33,7 @@#include <linux/list.h> #include <linux/completion.h> #include <linux/interrupt.h> -#include "viosrp.h" +#include <scsi/viosrp.h> struct scsi_cmnd ;struct Scsi_Host ;
drivers/scsi/ibmvscsi_tgt/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o + +ibmvscsis-objs := libsrp.o ibmvscsi_tgt.o +
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c new file +3965 -0
2,916 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h new file +342 -0
342 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/libsrp.c new file +427 -0
427 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/libsrp.h new file +123 -0
123 lines not on this page · raw message
drivers/scsi/libsrp.c deleted +0 -447
447 lines not on this page · raw message
include/scsi/libsrp.h deleted +0 -78
78 lines not on this page · raw message
include/scsi/viosrp.h renamed from drivers/scsi/ibmvscsi/viosrp.h +4 -9
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.5.4 (Apple Git-61)
Part of the diff is not shown here. View the raw message.
drivers/scsi/Kconfig config SCSI_PM8001 · line 1741
Quoted 10 lines
drivers/scsi/Kconfig +0
-10-config SCSI_SRP - tristate "SCSI RDMA Protocol helper library" - depends on SCSI && PCI - select SCSI_TGT - help - If you wish to use SRP target drivers, say Y. - - To compile this driver as a module, choose M here: the - module will be called libsrp. -
Please split that removal of libsrp into a separate patch before adding the new driver.
drivers/scsi/ibmvscsi_tgt/Makefile line 3
Quoted 8 lines
new file mode 100644
index 0000000..887574ddrivers/scsi/ibmvscsi_tgt/Makefile new file +3
-0@@ -0,0 +1,4 @@ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o + +ibmvscsis-objs := libsrp.o ibmvscsi_tgt.o
please use module-y for adding objects. Also what's the reason for splitting these files?
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 12 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +12
-0+/******************************************************************************* + * IBM Virtual SCSI Target Driver + * Copyright (C) 2003-2005 Dave Boutcher ([email protected]) IBM Corp. + * Santiago Leon ([email protected]) IBM Corp. + * Linda Xie ([email protected]) IBM Corp. + * + * Copyright (C) 2005-2011 FUJITA Tomonori <[email protected]> + * Copyright (C) 2010 Nicholas A. Bellinger <[email protected]> + * Copyright (C) 2016 Bryant G. Ly <[email protected]> IBM Corp. + * + * Authors: Bryant G. Ly <[email protected]> + * Authors: Michael Cyr <[email protected]>
What's the reational for the copyright vs Authors lines?
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 5 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +5
-0+#include "ibmvscsi_tgt.h" + +#ifndef H_GET_PARTNER_INFO +#define H_GET_PARTNER_INFO 0x0000000000000008LL +#endif
Should this be in a header with the other hcalls?
Quoted 1 line
+static const char ibmvscsis_driver_name[] = "ibmvscsis";
I think you can just assign the name directly in the driver ops structure.
Quoted 1 line
+static const char ibmvscsis_workq_name[] = "ibmvscsis";
This one seems unused.
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 1 line
drivers/scsi/ibmvscsi_tgt/Makefile new file +1
-0+ vscsi->flags &= (~PROCESSING_MAD);
No need for the braces here. (ditto for many other places later on)
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 2 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +2
-0+static long ibmvscsis_parse_command(struct scsi_info *vscsi, + struct viosrp_crq *crq);
Can you avoid forward declarations where easily possible, and if not keep them all at the beginning of the file?
Quoted 5 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +5
-0+static struct ibmvscsis_tport *ibmvscsis_lookup_port(const char *name) +{ + struct ibmvscsis_tport *tport = NULL; + struct vio_dev *vdev; + struct scsi_info *vscsi;
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 10 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +10
-0+ + spin_lock_bh(&ibmvscsis_dev_lock); + list_for_each_entry(vscsi, &ibmvscsis_dev_list, list) { + vdev = vscsi->dma_dev; + if (!strcmp(dev_name(&vdev->dev), name)) { + tport = &vscsi->tport; + break; + } + } + spin_unlock_bh(&ibmvscsis_dev_lock);
Without grabbing a reference this looks inherently unsafe.
Quoted 1 line
+static void
ibmvscsis_scheduler(struct work_struct *work)
Odd name for a work item.
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 9 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +9
-0+{ + struct ibmvscsis_cmd *cmd = container_of(work, struct ibmvscsis_cmd, + work); + struct scsi_info *vscsi = cmd->adapter; + + spin_lock_bh(&vscsi->intr_lock); + + /* Remove from schedule_q */ + list_del(&cmd->list);
What do you need the schedule_q for as the workqueue already tracks the commands?
Quoted 10 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +10
-0+static int ibmvscsis_alloc_cmds(struct scsi_info *vscsi, int num) +{ + struct ibmvscsis_cmd *cmd; + int i; + + INIT_LIST_HEAD(&vscsi->free_cmd); + vscsi->cmd_pool = kcalloc(num, sizeof(struct ibmvscsis_cmd), + GFP_KERNEL); + if (!vscsi->cmd_pool) + return -ENOMEM;
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 10 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +10
-0+ + for (i = 0, cmd = (struct ibmvscsis_cmd *)vscsi->cmd_pool; i < num; + i++, cmd++) { + cmd->adapter = vscsi; + INIT_WORK(&cmd->work, ibmvscsis_scheduler); + list_add_tail(&cmd->list, &vscsi->free_cmd); + } + + return 0; +}
Why can't you use the existing infrastructure for cmd pools in the target core?
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 9 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +9
-0+static void ibmvscsis_alloc_common_locks(struct scsi_info *vscsi) +{ + spin_lock_init(&vscsi->intr_lock); +} + +static void ibmvscsis_free_common_locks(struct scsi_info *vscsi) +{ + /* Nothing to do here */ +}
No need for these wrapers.
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 9 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +9
-0+static irqreturn_t ibmvscsis_interrupt(int dummy, void *data) +{ + struct scsi_info *vscsi = data; + + vio_disable_interrupts(vscsi->dma_dev); + tasklet_schedule(&vscsi->work_task); + + return IRQ_HANDLED; +}
Can you explain the need for the tasklet? There shouldn't be a whole lot of working before passing the command off to the workqueue anyway.
Quoted 6 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +6
-0+ rc = srp_transfer_data(cmd, &vio_iu(iue)->srp.cmd, ibmvscsis_rdma, 1, + 1); + if (rc) { + pr_err("srp_transfer_data failed: %d\n", rc); + sd = se_cmd->sense_buffer; + se_cmd->scsi_sense_length = 18;
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 10 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +10
-0+ memset(se_cmd->sense_buffer, 0, se_cmd->scsi_sense_length); + /* Current error */ + sd[0] = 0x70; + /* sense key = Medium Error */ + sd[2] = 3; + /* additional length (length - 8) */ + sd[7] = 10; + /* asc/ascq 0x801 = Logical Unit Communication time-out */ + sd[12] = 8; + sd[13] = 1;
The Fabrics driver shouldn't generate it's own sense codes. This would for example break for a lun using descriptor format sense data.
Quoted 5 lines · Christoph Hellwig
Quoted 5 lines
drivers/scsi/Kconfig +0
-5-config SCSI_SRP - tristate "SCSI RDMA Protocol helper library" - depends on SCSI && PCI - select SCSI_TGT - help
Quoted 8 lines
drivers/scsi/Kconfig config SCSI_PM8001 · line 1741
Quoted 5 lines
drivers/scsi/Kconfig +0
-5- If you wish to use SRP target drivers, say Y. - - To compile this driver as a module, choose M here: the - module will be called libsrp. -Please split that removal of libsrp into a separate patch before adding the new driver.
Why do you suggest splitting the path up for the libsrp stuff? The current upstream does not contain libsrp. The only reason the patch shows that there is a removal of libsrp is that James Bottomley suggested doing a revert of:
libsrp: removal - commit f6667938cfceefd8afe6355ceb6497dce4883ae9
to make it clear that I’m bringing back what had existed a year ago within the upstream.
Quoted 13 lines
drivers/scsi/ibmvscsi_tgt/Makefile line 3
Quoted 9 lines
new file mode 100644
index 0000000..887574ddrivers/scsi/ibmvscsi_tgt/Makefile new file +3
-0@@ -0,0 +1,4 @@ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o + +ibmvscsis-objs := libsrp.o ibmvscsi_tgt.oplease use module-y for adding objects. Also what's the reason for splitting these files?
I will change to module-y. The reason is we are possibly going to write another target fabric in the future with the IBMVFC driver so just incase we want to leave it separated for now.
Quoted 13 lines
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 12 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +12
-0+/******************************************************************************* + * IBM Virtual SCSI Target Driver + * Copyright (C) 2003-2005 Dave Boutcher ([email protected]) IBM Corp. + * Santiago Leon ([email protected]) IBM Corp. + * Linda Xie ([email protected]) IBM Corp. + * + * Copyright (C) 2005-2011 FUJITA Tomonori <[email protected]> + * Copyright (C) 2010 Nicholas A. Bellinger <[email protected]> + * Copyright (C) 2016 Bryant G. Ly <[email protected]> IBM Corp. + * + * Authors: Bryant G. Ly <[email protected]> + * Authors: Michael Cyr <[email protected]>
Quoted 1 line
What's the reational for the copyright vs Authors lines?
No reason, ill remove the copyright.
Quoted 8 lines
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 6 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +5
-0+#include "ibmvscsi_tgt.h" + +#ifndef H_GET_PARTNER_INFO +#define H_GET_PARTNER_INFO 0x0000000000000008LL +#endifShould this be in a header with the other hcalls?
Yes, Moved.
Quoted 5 lines
Quoted 2 lines
+static const char ibmvscsis_driver_name[] = "ibmvscsis";
I think you can just assign the name directly in the driver ops structure.
Fixed.
Quoted 4 lines
Quoted 2 lines
+static const char ibmvscsis_workq_name[] = "ibmvscsis";
This one seems unused.
Removed
Quoted 10 lines
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 2 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +1
-0+ vscsi->flags &= (~PROCESSING_MAD);No need for the braces here. (ditto for many other places later on)
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 2 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +2
-0+static long ibmvscsis_parse_command(struct scsi_info *vscsi, + struct viosrp_crq *crq);Can you avoid forward declarations where easily possible, and if not keep them all at the beginning of the file?
Will do.
<SNIP>
Quoted 15 lines
Quoted 15 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +15
-0+static int ibmvscsis_alloc_cmds(struct scsi_info *vscsi, int num) +{ + struct ibmvscsis_cmd *cmd; + int i; + + INIT_LIST_HEAD(&vscsi->free_cmd); + vscsi->cmd_pool = kcalloc(num, sizeof(struct ibmvscsis_cmd), + GFP_KERNEL); + if (!vscsi->cmd_pool) + return -ENOMEM; + + for (i = 0, cmd = (struct ibmvscsis_cmd *)vscsi->cmd_pool; i < num; + i++, cmd++) { + cmd->adapter = vscsi; + INIT_WORK(&cmd->work, ibmvscsis_scheduler);
Quoted 9 lines
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 5 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +5
-0+ list_add_tail(&cmd->list, &vscsi->free_cmd); + } + + return 0; +}Why can't you use the existing infrastructure for cmd pools in the target core?
I wasn’t aware there was existing infrastructure.
<SNIP>
Quoted 11 lines
Quoted 11 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +11
-0+ rc = srp_transfer_data(cmd, &vio_iu(iue)->srp.cmd, ibmvscsis_rdma, 1, + 1); + if (rc) { + pr_err("srp_transfer_data failed: %d\n", rc); + sd = se_cmd->sense_buffer; + se_cmd->scsi_sense_length = 18; + memset(se_cmd->sense_buffer, 0, se_cmd->scsi_sense_length); + /* Current error */ + sd[0] = 0x70; + /* sense key = Medium Error */ + sd[2] = 3;
Quoted 8 lines
drivers/scsi/ibmvscsi_tgt/Makefile
Quoted 5 lines
drivers/scsi/ibmvscsi_tgt/Makefile new file +5
-0+ /* additional length (length - 8) */ + sd[7] = 10; + /* asc/ascq 0x801 = Logical Unit Communication time-out */ + sd[12] = 8; + sd[13] = 1;The Fabrics driver shouldn't generate it's own sense codes. This would for example break for a lun using descriptor format sense data.
Changed to:
if (rc) {
pr_err("srp_transfer_data failed: %d\n", rc);
sd = se_cmd->sense_buffer;
se_cmd->scsi_sense_length = 18;
memset(se_cmd->sense_buffer, 0, se_cmd->scsi_sense_length);
/* Fixed/Current Error = 0
* Sense Key = Medium Error (0x03)
* Additonal Length = 0xa
* Logical Unit Communication Time-out asc/ascq = 0x801
*/
scsi_build_sense_buffer(0, se_cmd->sense_buffer, MEDIUM_ERROR,
0x08, 0x01);
}Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Responding to those issues not already addressed by Bryant.
On 6/23/16 9:22 AM, Christoph Hellwig wrote:
<SNIP>
Quoted 2 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c line 501
Quoted 1 line
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c new file +1
-0+ vscsi->flags &= (~PROCESSING_MAD );No need for the braces here. (ditto for many other places later on)
Fixed.
<SNIP>
Quoted 8 lines
Quoted 8 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c new file +8
-0+static struct ibmvscsis_tport *ibmvscsis_lookup_port (const char *name) +{ +struct ibmvscsis_tport *tport =NULL ; +struct vio_dev *vdev; +struct scsi_info *vscsi; + +spin_lock_bh (&ibmvscsis_dev_lock); +list_for_each_entry (vscsi, &ibmvscsis_dev_list, list) {
Quoted 8 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c line 2359
Quoted 7 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c new file +7
-0+ vdev = vscsi->dma_dev; +if (!strcmp (dev_name (&vdev->dev), name)) { + tport = &vscsi->tport; +break ; + } + } +spin_unlock_bh (&ibmvscsis_dev_lock);Without grabbing a reference this looks inherently unsafe.
I don't understand your concern. Could you please provide more detail?
Quoted 2 lines
Quoted 1 line
+static void
ibmvscsis_scheduler(struct work_struct *work)Odd name for a work item.
Not sure why it seems odd. It schedules work to TCM.
Quoted 11 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c line 2542
Quoted 9 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c new file +9
-0+{ + struct ibmvscsis_cmd *cmd = container_of(work, struct ibmvscsis_cmd, + work); +struct scsi_info *vscsi = cmd->adapter; + +spin_lock_bh (&vscsi->intr_lock); + +/* Remove from schedule_q */ +list_del (&cmd->list);What do you need the
schedule_qfor as the workqueue already tracks the commands?
There are a number of places where we need to see if there is anything on the work queue, and I am not aware of an existing function to do this, so we keep our own list of commands which have been queued.
<SNIP>
Quoted 10 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c line 2668
Quoted 9 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c new file +9
-0+static void ibmvscsis_alloc_common_locks (struct scsi_info *vscsi) +{ +spin_lock_init (&vscsi->intr_lock); +} + +static void ibmvscsis_free_common_locks (struct scsi_info *vscsi) +{ +/* Nothing to do here */ +}No need for these wrapers.
Removed.
Quoted 11 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c line 2678
Quoted 9 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c new file +9
-0+static irqreturn_t ibmvscsis_interrupt (int dummy,void *data) +{ +struct scsi_info *vscsi = data; + +vio_disable_interrupts (vscsi->dma_dev); +tasklet_schedule (&vscsi->work_task); + +return IRQ_HANDLED ; +}Can you explain the need for the tasklet? There shouldn't be a whole lot of working before passing the command off to the workqueue anyway.
There are some requests, like SRP Login and the various MADs, which can be handled at the interrupt level, and so we do so.
PATCH v8 1/1 ibmvscsis: Initial commit of IBM VSCSI Tgt Driver
In reply to Bryant G. LyFrom: "Bryant G. Ly" <[email protected]>
This driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119
The driver provides a virtual SCSI device on IBM Power Servers.
This patch contains the initial merge of the tcm ibmvscsis driver. More information on this driver and config can be found:
https://github.com/powervm/ibmvscsis/wiki/Configuration
http://www.linux-iscsi.org/wiki/IBM_vSCSI
---
Version 8:
- Fixed issues raised by Christoph Hellwig.
Version 7:
- Removed old module from drivers/scsi/ibmvscsi/Makefile
- Fixed styling from Joe Perches comments.
Version 6:
- Removed modification of report luns
- fixed Maintainers file
- removed #include <target/target_core_backend.h>
Version 5:
- changed to use scsilun_to_int
- removed inquiry modification
- changed to use target_alloc_session
- removed shutdown_session, etc
Version 4:
- Changed some print statements to dev_err.
-Also changed to use target_alloc_session instead of manually coding it.
- Removed scsi_cmnd and scsi_host bits removed from libsrp to completely
- Stripped out un-needed includes.
- Added pre-allocation of commands before IO starts.
- Added Support for Transport event, fast-fail support, MESSAGE_IN_CRQ format
- Changed the way queues are handled for better performance, and state mgmt.
Version 3:
- Revert old libsrp and make it clear resurrection old vscsi target driver
- Made libsrp a linked file to the ibmvscsis module
Version 2:
-Fixed comments from Bart/Joe in regards to styling and code structure
MAINTAINERS | 10 +-
drivers/scsi/Kconfig | 27 +-
drivers/scsi/Makefile | 2 +-
drivers/scsi/ibmvscsi/ibmvfc.h | 2 +-
drivers/scsi/ibmvscsi/ibmvscsi.h | 2 +-
drivers/scsi/ibmvscsi_tgt/Makefile | 4 +
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3965 ++++++++++++++++++++++
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 342 ++
drivers/scsi/ibmvscsi_tgt/libsrp.c | 427 +++
drivers/scsi/ibmvscsi_tgt/libsrp.h | 123 +
drivers/scsi/libsrp.c | 447 ---
include/scsi/libsrp.h | 78 -
{drivers/scsi/ibmvscsi => include/scsi}/viosrp.h | 13 +-
13 files changed, 4894 insertions(+), 548 deletions(-)
create mode 100644 drivers/scsi/ibmvscsi_tgt/Makefile
create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h
create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.c
create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.h
delete mode 100644 drivers/scsi/libsrp.c
delete mode 100644 include/scsi/libsrp.h
rename {drivers/scsi/ibmvscsi => include/scsi}/viosrp.h (92%)MAINTAINERS +9 -1
@@ -5449,7 +5449,15 @@ M: Tyrel Datwyler <[email protected]> L: [email protected] S: Supported F: drivers/scsi/ibmvscsi/ibmvscsi* -F: drivers/scsi/ibmvscsi/viosrp.h +F: include/scsi/viosrp.h + +IBM Power Virtual SCSI Device Target Driver +M: Bryant G. Ly <[email protected]> +M: Michael Cyr <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: drivers/scsi/ibmvscsi_tgt/ IBM Power Virtual FC Device Drivers M: Tyrel Datwyler <[email protected]>
drivers/scsi/Kconfig +17 -10
@@ -848,6 +848,23 @@ config SCSI_IBMVSCSI To compile this driver as a module, choose M here: the module will be called ibmvscsi. +config SCSI_IBMVSCSIS + tristate "IBM Virtual SCSI Server support" + depends on PPC_PSERIES && TARGET_CORE && SCSI && PCI + help + This is the IBM POWER Virtual SCSI Target Server + This driver uses the SRP protocol for communication betwen servers + guest and/or the host that run on the same server. + More information on VSCSI protocol can be found at www.power.org + + The userspace configuration needed to initialize the driver can be + be found here: + + https://github.com/powervm/ibmvscsis/wiki/Configuration + + To compile this driver as a module, choose M here: the + module will be called ibmvstgt. + config SCSI_IBMVFC tristate "IBM Virtual FC support" depends on PPC_PSERIES && SCSI
@@ -1729,16 +1746,6 @@ config SCSI_PM8001 This driver supports PMC-Sierra PCIE SAS/SATA 8x6G SPC 8001 chip based host adapters. -config SCSI_SRP - tristate "SCSI RDMA Protocol helper library" - depends on SCSI && PCI - select SCSI_TGT - help - If you wish to use SRP target drivers, say Y. - - To compile this driver as a module, choose M here: the - module will be called libsrp. - config SCSI_BFA_FC tristate "Brocade BFA Fibre Channel Support" depends on PCI && SCSI
drivers/scsi/Makefile +1 -1
@@ -127,8 +127,8 @@ obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o obj-$(CONFIG_SCSI_SNI_53C710) += 53c700.o sni_53c710.o obj-$(CONFIG_SCSI_NSP32) += nsp32.o obj-$(CONFIG_SCSI_IPR) += ipr.o -obj-$(CONFIG_SCSI_SRP) += libsrp.o obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsi_tgt/ obj-$(CONFIG_SCSI_IBMVFC) += ibmvscsi/ obj-$(CONFIG_SCSI_HPTIOP) += hptiop.o obj-$(CONFIG_SCSI_STEX) += stex.o
drivers/scsi/ibmvscsi/ibmvfc.h +1 -1
@@ -26,7 +26,7 @@#include <linux/list.h> #include <linux/types.h> -#include "viosrp.h" +#include <scsi/viosrp.h> #define IBMVFC_NAME "ibmvfc"#define IBMVFC_DRIVER_VERSION "1.0.11"
drivers/scsi/ibmvscsi/ibmvscsi.h +1 -1
@@ -33,7 +33,7 @@#include <linux/list.h> #include <linux/completion.h> #include <linux/interrupt.h> -#include "viosrp.h" +#include <scsi/viosrp.h> struct scsi_cmnd ;struct Scsi_Host ;
drivers/scsi/ibmvscsi_tgt/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o + +ibmvscsis-objs := libsrp.o ibmvscsi_tgt.o +
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c new file +3965 -0
2,916 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h new file +342 -0
342 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/libsrp.c new file +427 -0
427 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/libsrp.h new file +123 -0
123 lines not on this page · raw message
drivers/scsi/libsrp.c deleted +0 -447
447 lines not on this page · raw message
include/scsi/libsrp.h deleted +0 -78
78 lines not on this page · raw message
include/scsi/viosrp.h renamed from drivers/scsi/ibmvscsi/viosrp.h +4 -9
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.5.0
Part of the diff is not shown here. View the raw message.
On 6/27/16, 3:17 PM, "Michael Cyr" <[email protected] on behalf of [email protected]> wrote:
<SNIP>
+ cmd->se_cmd.tag = be64_to_cpu(srp->tag);
+
+ spin_lock_bh(&vscsi->intr_lock);
+ list_add_tail(&cmd->list, &vscsi->active_q);
+ spin_unlock_bh(&vscsi->intr_lock);
+
+ srp->lun.scsi_lun[0] &= 0x3f;
+
+ pr_debug("calling submit_cmd, se_cmd %p, lun 0x%llx, cdb 0x%x, attr:%d\n",
+ &cmd->se_cmd, scsilun_to_int(&srp->lun), (int)srp->cdb[0],
+ attr);
+
+ rc = target_submit_cmd(&cmd->se_cmd, nexus->se_sess, srp->cdb,
+ cmd->sense_buf, scsilun_to_int(&srp->lun),
+ data_len, attr, dir, 0);
+ if (rc) {
<SNIP>
+ * ibmvscsis_parse_task() - Parse SRP Task Management Request
+ *
+ * Parse the srp task management request; if it is valid then submit it to tcm.
+ * Note: The return code does not reflect the status of the task management
+ * request.
+ *
+ * EXECUTION ENVIRONMENT:
+ * Processor level
+ */
+static void ibmvscsis_parse_task(struct scsi_info *vscsi,
+ struct ibmvscsis_cmd *cmd)
+{
<SNIP>
+ spin_lock_bh(&vscsi->intr_lock);
+ list_add_tail(&cmd->list, &vscsi->active_q);
+ spin_unlock_bh(&vscsi->intr_lock);
+
+ srp_tsk->lun.scsi_lun[0] &= 0x3f;
+
+ pr_debug("calling submit_tmr, func %d\n",
+ srp_tsk->tsk_mgmt_func);
+ rc = target_submit_tmr(&cmd->se_cmd, nexus->se_sess, NULL,
+ scsilun_to_int(&srp_tsk->lun), srp_tsk,
+ tcm_type, GFP_KERNEL, tag_to_abort, 0);
+ if (rc) {
<SNIP>
I was hoping someone in the community can help answer this:
If I were to remove the masking off of the lun addressing method prior to target_submit_cmd/target_submit_tmr then I get a hang within scsi probe on bootup. (srp->lun.scsi_lun[0] &= 0x3f; and srp_tsk->lun.scsi_lun[0] &= 0x3f;)
[ 0.842648] ibmvscsi 3000000d: sent SRP login [ 0.842667] ibmvscsi 3000000d: SRP_LOGIN succeeded [ 0.842682] scsi 0:0:2:0: CD-ROM AIX VOPTA PQ: 0 ANSI: 4 [ OK ] Started Show Plymouth Boot Screen. [ OK ] Reached target Paths. [ OK ] Reached target Basic System. [ 0.886179] sr 0:0:2:0: [sr0] scsi-1 drive [ 0.886199] cdrom: Uniform CD-ROM driver Revision: 3.20 [ 0.888582] sd 0:0:1:0: [sda] 41943040 512-byte logical blocks: (21.4 GB/20.0 GiB) [ 0.888657] sd 0:0:1:0: [sda] Write Protect is off [ 0.888712] sd 0:0:1:0: [sda] Cache data unavailable [ 0.888722] sd 0:0:1:0: [sda] Assuming drive cache: write through [ 0.901443] sda: sda1 sda2 sda3 [ 0.901838] sd 0:0:1:0: [sda] Attached SCSI disk [ 124.522778] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts [ 125.151242] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts [ 125.662808] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
Does anyone know of the reasoning for having to mask off the addressing method prior to submitting to target?
Thanks,
Bryant
PATCH v9 1/1 ibmvscsis: Initial commit of IBM VSCSI Tgt Driver
In reply to Bryant G. LyFrom: "Bryant G. Ly" <[email protected]>
This driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119
The driver provides a virtual SCSI device on IBM Power Servers.
This patch contains the fifth version for an initial merge of the tcm ibmvscsis driver. More information on this driver and config can be found:
https://github.com/powervm/ibmvscsis/wiki/Configuration
http://www.linux-iscsi.org/wiki/IBM_vSCSI
---
Version 9:
- Fixed issues raised by Christoph Hellwig.
Version 8:
- Badly formed patch, ignore.
Version 7:
- Removed old module from drivers/scsi/ibmvscsi/Makefile
- Fixed styling from Joe Perches comments.
Version 6:
- Removed modification of report luns
- fixed Maintainers file
- removed #include <target/target_core_backend.h>
Version 5:
- changed to use scsilun_to_int
- removed inquiry modification
- changed to use target_alloc_session
- removed shutdown_session, etc
Version 4:
- Changed some print statements to dev_err.
-Also changed to use target_alloc_session instead of manually coding it.
- Removed scsi_cmnd and scsi_host bits removed from libsrp to completely
- Stripped out un-needed includes.
- Added pre-allocation of commands before IO starts.
- Added Support for Transport event, fast-fail support, MESSAGE_IN_CRQ format
- Changed the way queues are handled for better performance, and state mgmt.
Version 3:
- Revert old libsrp and make it clear resurrection old vscsi target driver
- Made libsrp a linked file to the ibmvscsis module
Version 2:
-Fixed comments from Bart/Joe in regards to styling and code structure
MAINTAINERS | 10 +-
drivers/scsi/Kconfig | 27 +-
drivers/scsi/Makefile | 2 +-
drivers/scsi/ibmvscsi/ibmvfc.h | 2 +-
drivers/scsi/ibmvscsi/ibmvscsi.h | 2 +-
drivers/scsi/ibmvscsi_tgt/Makefile | 4 +
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 4087 ++++++++++++++++++++++
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 346 ++
drivers/scsi/ibmvscsi_tgt/libsrp.c | 427 +++
drivers/scsi/ibmvscsi_tgt/libsrp.h | 123 +
drivers/scsi/libsrp.c | 447 ---
include/scsi/libsrp.h | 78 -
{drivers/scsi/ibmvscsi => include/scsi}/viosrp.h | 13 +-
13 files changed, 5020 insertions(+), 548 deletions(-)
create mode 100644 drivers/scsi/ibmvscsi_tgt/Makefile
create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h
create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.c
create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.h
delete mode 100644 drivers/scsi/libsrp.c
delete mode 100644 include/scsi/libsrp.h
rename {drivers/scsi/ibmvscsi => include/scsi}/viosrp.h (92%)MAINTAINERS +9 -1
@@ -5449,7 +5449,15 @@ M: Tyrel Datwyler <[email protected]> L: [email protected] S: Supported F: drivers/scsi/ibmvscsi/ibmvscsi* -F: drivers/scsi/ibmvscsi/viosrp.h +F: include/scsi/viosrp.h + +IBM Power Virtual SCSI Device Target Driver +M: Bryant G. Ly <[email protected]> +M: Michael Cyr <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: drivers/scsi/ibmvscsi_tgt/ IBM Power Virtual FC Device Drivers M: Tyrel Datwyler <[email protected]>
drivers/scsi/Kconfig +17 -10
@@ -848,6 +848,23 @@ config SCSI_IBMVSCSI To compile this driver as a module, choose M here: the module will be called ibmvscsi. +config SCSI_IBMVSCSIS + tristate "IBM Virtual SCSI Server support" + depends on PPC_PSERIES && TARGET_CORE && SCSI && PCI + help + This is the IBM POWER Virtual SCSI Target Server + This driver uses the SRP protocol for communication betwen servers + guest and/or the host that run on the same server. + More information on VSCSI protocol can be found at www.power.org + + The userspace configuration needed to initialize the driver can be + be found here: + + https://github.com/powervm/ibmvscsis/wiki/Configuration + + To compile this driver as a module, choose M here: the + module will be called ibmvstgt. + config SCSI_IBMVFC tristate "IBM Virtual FC support" depends on PPC_PSERIES && SCSI
@@ -1729,16 +1746,6 @@ config SCSI_PM8001 This driver supports PMC-Sierra PCIE SAS/SATA 8x6G SPC 8001 chip based host adapters. -config SCSI_SRP - tristate "SCSI RDMA Protocol helper library" - depends on SCSI && PCI - select SCSI_TGT - help - If you wish to use SRP target drivers, say Y. - - To compile this driver as a module, choose M here: the - module will be called libsrp. - config SCSI_BFA_FC tristate "Brocade BFA Fibre Channel Support" depends on PCI && SCSI
drivers/scsi/Makefile +1 -1
@@ -127,8 +127,8 @@ obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o obj-$(CONFIG_SCSI_SNI_53C710) += 53c700.o sni_53c710.o obj-$(CONFIG_SCSI_NSP32) += nsp32.o obj-$(CONFIG_SCSI_IPR) += ipr.o -obj-$(CONFIG_SCSI_SRP) += libsrp.o obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsi_tgt/ obj-$(CONFIG_SCSI_IBMVFC) += ibmvscsi/ obj-$(CONFIG_SCSI_HPTIOP) += hptiop.o obj-$(CONFIG_SCSI_STEX) += stex.o
drivers/scsi/ibmvscsi/ibmvfc.h +1 -1
@@ -26,7 +26,7 @@#include <linux/list.h> #include <linux/types.h> -#include "viosrp.h" +#include <scsi/viosrp.h> #define IBMVFC_NAME "ibmvfc"#define IBMVFC_DRIVER_VERSION "1.0.11"
drivers/scsi/ibmvscsi/ibmvscsi.h +1 -1
@@ -33,7 +33,7 @@#include <linux/list.h> #include <linux/completion.h> #include <linux/interrupt.h> -#include "viosrp.h" +#include <scsi/viosrp.h> struct scsi_cmnd ;struct Scsi_Host ;
drivers/scsi/ibmvscsi_tgt/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsis.o + +ibmvscsis-y := libsrp.o ibmvscsi_tgt.o +
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c new file +4087 -0
2,916 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h new file +346 -0
346 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/libsrp.c new file +427 -0
427 lines not on this page · raw message
drivers/scsi/ibmvscsi_tgt/libsrp.h new file +123 -0
123 lines not on this page · raw message
drivers/scsi/libsrp.c deleted +0 -447
447 lines not on this page · raw message
include/scsi/libsrp.h deleted +0 -78
78 lines not on this page · raw message
include/scsi/viosrp.h renamed from drivers/scsi/ibmvscsi/viosrp.h +4 -9
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.5.0
Part of the diff is not shown here. View the raw message.
Quoted 23 lines · Bryant G. Ly
I was hoping someone in the community can help answer this:
If I were to remove the masking off of the lun addressing method prior to target_submit_cmd/target_submit_tmr then I get a hang within scsi probe on bootup. (srp->lun.scsi_lun[0] &=
0x3f; and srp_tsk->lun.scsi_lun[0] &=0x3f;)[ 0.842648] ibmvscsi 3000000d: sent SRP login [ 0.842667] ibmvscsi 3000000d: SRP_LOGIN succeeded [ 0.842682] scsi 0:0:2:0: CD-ROM AIX VOPTA PQ: 0 ANSI: 4 [ OK ] Started Show Plymouth Boot Screen. [ OK ] Reached target Paths. [ OK ] Reached target Basic System. [ 0.886179] sr 0:0:2:0: [sr0] scsi-1 drive [ 0.886199] cdrom: Uniform CD-ROM driver Revision: 3.20 [ 0.888582] sd 0:0:1:0: [sda] 41943040 512-byte logical blocks: (21.4 GB/20.0 GiB) [ 0.888657] sd 0:0:1:0: [sda] Write Protect is off [ 0.888712] sd 0:0:1:0: [sda] Cache data unavailable [ 0.888722] sd 0:0:1:0: [sda] Assuming drive cache: write through [ 0.901443] sda: sda1 sda2 sda3 [ 0.901838] sd 0:0:1:0: [sda] Attached SCSI disk [ 124.522778] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts [ 125.151242] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts [ 125.662808] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
Quoted 2 lines
Does anyone know of the reasoning for having to mask off the addressing method prior to submitting to target?
How long have you waited before giving up waiting? The SCSI initiator sends a REPORT LUN and other SCSI commands to LUN 0. If LUN 0 is missing these commands will time out but that should not cause a hang. Anyway, SysRq-w should help to determine the cause of the hang.
Bart.
Quoted 23 lines · Bart Van Assche
Quoted 23 lines
I was hoping someone in the community can help answer this:
If I were to remove the masking off of the lun addressing method prior to target_submit_cmd/target_submit_tmr then I get a hang within scsi probe on bootup. (srp->lun.scsi_lun[0] &=
0x3f; and srp_tsk->lun.scsi_lun[0] &=0x3f;)[ 0.842648] ibmvscsi 3000000d: sent SRP login [ 0.842667] ibmvscsi 3000000d: SRP_LOGIN succeeded [ 0.842682] scsi 0:0:2:0: CD-ROM AIX VOPTA PQ: 0 ANSI: 4 [ OK ] Started Show Plymouth Boot Screen. [ OK ] Reached target Paths. [ OK ] Reached target Basic System. [ 0.886179] sr 0:0:2:0: [sr0] scsi-1 drive [ 0.886199] cdrom: Uniform CD-ROM driver Revision: 3.20 [ 0.888582] sd 0:0:1:0: [sda] 41943040 512-byte logical blocks: (21.4 GB/20.0 GiB) [ 0.888657] sd 0:0:1:0: [sda] Write Protect is off [ 0.888712] sd 0:0:1:0: [sda] Cache data unavailable [ 0.888722] sd 0:0:1:0: [sda] Assuming drive cache: write through [ 0.901443] sda: sda1 sda2 sda3 [ 0.901838] sd 0:0:1:0: [sda] Attached SCSI disk [ 124.522778] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts [ 125.151242] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts [ 125.662808] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
Quoted 7 lines
Quoted 2 lines
Does anyone know of the reasoning for having to mask off the addressing method prior to submitting to target?
How long have you waited before giving up waiting? The SCSI initiator sends a REPORT LUN and other SCSI commands to LUN 0. If LUN 0 is missing these commands will time out but that should not cause a hang. Anyway, SysRq-w should help to determine the cause of the hang.
[ 0.852777] ibmvscsi 30000002: SRP_LOGIN succeeded
[ OK ] Reached target System Initialization.
Starting dracut initqueue hook...
Starting Show Plymouth Boot Screen...
[ 0.872421] ibmvscsi 3000000d: SRP_VERSION: 16.a
[ 0.872561] scsi 0:0:1:0: Direct-Access AIX VDASD 0001 PQ: 0 ANSI: 3
[ 0.872635] scsi host1: IBM POWER Virtual SCSI Adapter 1.5.9
[ 0.872846] ibmvscsi 3000000d: partner initialization complete
[ 0.872897] ibmvscsi 3000000d: host srp version: 16.a, host partition (0), OS 2, max io 8388608
[ 0.872917] ibmvscsi 3000000d: sent SRP login
[ 0.872937] ibmvscsi 3000000d: SRP_LOGIN succeeded
[ 0.872953] scsi 0:0:2:0: CD-ROM AIX VOPTA PQ: 0 ANSI: 4
[ OK ] Started Show Plymouth Boot Screen.
[ OK ] Reached target Paths.
[ OK ] Reached target Basic System.
[ 0.915670] sr 0:0:2:0: [sr0] scsi-1 drive
[ 0.915690] cdrom: Uniform CD-ROM driver Revision: 3.20
[ 0.917957] sd 0:0:1:0: [sda] 41943040 512-byte logical blocks: (21.4 GB/20.0 GiB)
[ 0.918035] sd 0:0:1:0: [sda] Write Protect is off
[ 0.918092] sd 0:0:1:0: [sda] Cache data unavailable
[ 0.918104] sd 0:0:1:0: [sda] Assuming drive cache: write through
[ 0.929717] sda: sda1 sda2 sda3
[ 0.930107] sd 0:0:1:0: [sda] Attached SCSI disk
[ 124.662745] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 125.311128] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 125.822847] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 126.332803] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 126.842856] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 127.352800] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 127.862721] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 128.372729] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 128.882699] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 129.392709] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 129.902698] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 130.412724] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 130.922700] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 131.432729] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 131.942724] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 132.452690] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 132.962679] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 133.472687] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 133.982712] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 134.492676] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 135.002685] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 135.512703] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 136.031192] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 136.542927] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 137.061147] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 137.581052] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 138.092784] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 138.602771] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 139.121088] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 139.632833] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 140.142838] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 140.661084] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 141.172730] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 141.682787] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 142.192734] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 142.702783] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 143.212748] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 143.722734] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 144.232733] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 144.742790] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 145.252784] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 145.762777] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 146.272756] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 146.782800] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 147.292805] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 147.802770] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 148.312797] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 148.822804] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 149.332777] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 149.842781] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 150.361072] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 150.872765] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 151.382758] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 151.892803] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 152.402738] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 152.912787] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 153.422744] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 153.941075] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 154.461068] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 154.981113] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 155.492757] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 156.002744] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 156.512757] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 157.022779] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 157.532720] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 158.051090] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 158.563207] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 159.072854] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 159.583209] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 160.101149] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 160.612963] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 161.123115] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 161.632853] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 162.151180] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
ng timeout scripts
[ 185.722864] dracut-initqueue[353]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 185.723229] dracut-initqueue[353]: Warning: Could not boot.
[ 185.725988] dracut-initqueue[353]: Warning: /dev/mapper/rhel_vscsi--bry-root does not exist
[ 185.726216] dracut-initqueue[353]: Warning: /dev/rhel_vscsi-bry/root does not exist
[ 185.726446] dracut-initqueue[353]: Warning: /dev/rhel_vscsi-bry/swap does not exist
Starting Dracut Emergency Shell...Warning: /dev/mapper/rhel_vscsi--bry-root does not exist
Warning: /dev/rhel_vscsi-bry/root does not exist
Warning: /dev/rhel_vscsi-bry/swap does not exist
Generating "/run/initramfs/rdsosreport.txt"
Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot after mounting them and attach it to a bug report.
dracut:/# vim /run/initramfs/rdsosreport.txt
My mistake, it did not hang but the initiator doesn’t finish booting up. But this time I tried it with a LUN 0 there instead of not having one.
/> ls
o- / .............................................................................. [...]
o- backstores ................................................................... [...]
| o- fileio ....................................................... [2 Storage Objects] | | o- LUN_0 ............................................. [5.0M, /tmp/tmp.img, in use] | | o- RHEL ................................. [19.0G, /home/sdn1/rhel_disk.img, in use] | o- iblock ........................................................ [0 Storage Object] | o- pscsi ......................................................... [0 Storage Object] | o- rd_mcp ........................................................ [0 Storage Object] o- ibmvscsis ............................................................... [1 Target] | o- 3000000e ............................................................... [enabled] | o- luns .................................................................. [2 LUNs] | o- lun0 ........................................... [fileio/LUN_0 (/tmp/tmp.img)] | o- lun1 ................................ [fileio/RHEL (/home/sdn1/rhel_disk.img)] o- iscsi .................................................................. [0 Targets] o- loopback ............................................................... [0 Targets] [63903.512535] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x0000b660 [63903.512593] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x0000b760 [63903.512654] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x0000b860 [63903.512711] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x0000b960 [63903.512771] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x0000ba60 [63903.512828] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x0000bb60 [63903.512888] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x0000bc60 [63903.513659] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x0000bd60 [63903.513730] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x0000be60 [63903.513793] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x0000bf60
But if I tried the same thing with the masking:
[ 196.926548] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x00003660 [ 196.926607] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x00003760 [ 196.926663] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x00003860 [ 196.926723] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x00003960 [ 196.926783] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x00003a60 [ 196.926843] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x00003b60 [ 196.926900] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x00003c60 [ 196.926960] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x00003d60 [ 196.927019] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x00003e60 [ 196.927079] TARGET_CORE[ibmvscsis]: Detected NON_EXISTENT_LUN Access for 0x00003f60
It looks like the masking fixes the device mapper’s ability to find the disk….
-Bryant
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 1 line · Bryant G. Ly
It looks like the masking fixes the device mapper’s ability to find the disk….
Is the multipath client available in your initrd? If so, running multipath -ll -v<n> with n >= 3 should reveal why multipathd ignored certain disks.
Bart.
On 6/29/16, 9:54 AM, "Bart Van Assche" <[email protected] on behalf of [email protected]> wrote:
Quoted 5 lines · Bryant G. Ly
Quoted 1 line
It looks like the masking fixes the device mapper’s ability to find the disk….
Is the multipath client available in your initrd? If so, running multipath -ll -v<n> with n >= 3 should reveal why multipathd ignored certain disks.
I enabled it on the initiator:
[root@vscsi-bry ~]# multipath -ll [root@vscsi-bry ~]# multipath -ll -v<n> with n >= 3 -bash: n: No such file or directory [root@vscsi-bry ~]# mpathconf
multipath is enabledfind_multipaths is enabled user_friendly_names is enableddm_multipath module is loaded
multipathd is running
[root@vscsi-bry ~]#
But it seems to not do much.
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Michael, Bryant & Co,
Apologies for the extended follow-up over the summer holiday.
Comments below.
Quoted 72 lines · Michael Cyr
From: "Bryant G. Ly" <[email protected]>
This driver is a pick up of the old IBM VIO scsi Target Driver that was started by Nick and Fujita 2-4 years ago.
http://comments.gmane.org/gmane.linux.scsi/90119The driver provides a virtual SCSI device on IBM Power Servers.
This patch contains the fifth version for an initial merge of the tcm ibmvscsis driver. More information on this driver and config can be found:
https://github.com/powervm/ibmvscsis/wiki/Configuration
http://www.linux-iscsi.org/wiki/IBM_vSCSISigned-off-by Steven Royer <[email protected]>Signed-off-by Tyrel Datwyler <[email protected]>Signed-off-by Michael Cyr <[email protected]>Signed-off-by Bryant G. Ly <[email protected]>---
Version 9:
- Fixed issues raised by Christoph Hellwig.Version 8:
- Badly formed patch, ignore.Version 7:
- Removed old module fromdrivers/scsi/ibmvscsi/Makefile
- Fixed styling from Joe Perches comments.Version 6:
- Removed modification of report luns
- fixed Maintainers file
- removed #include <target/target_core_backend.h>Version 5:
- changed to usescsilun_to_int
- removed inquiry modification
- changed to usetarget_alloc_session
- removedshutdown_session, etcVersion 4:
- Changed some print statements todev_err.
-Also changed to usetarget_alloc_sessioninstead of manually coding it.
- Removedscsi_cmndandscsi_hostbits removed from libsrp to completely
- Stripped out un-needed includes.
- Added pre-allocation of commands before IO starts.
- Added Support for Transport event, fast-fail support,MESSAGE_IN_CRQformat
- Changed the way queues are handled for better performance, and state mgmt.Version 3:
- Revert old libsrp and make it clear resurrection old vscsi target driver
- Made libsrp a linked file to the ibmvscsis moduleVersion 2:
-Fixed comments from Bart/Joe in regards to styling and code structureMAINTAINERS | 10 +- drivers/scsi/Kconfig | 27 +- drivers/scsi/Makefile | 2 +- drivers/scsi/ibmvscsi/ibmvfc.h | 2 +- drivers/scsi/ibmvscsi/ibmvscsi.h | 2 +- drivers/scsi/ibmvscsi_tgt/Makefile | 4 + drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 4087 ++++++++++++++++++++++ drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 346 ++ drivers/scsi/ibmvscsi_tgt/libsrp.c | 427 +++ drivers/scsi/ibmvscsi_tgt/libsrp.h | 123 + drivers/scsi/libsrp.c | 447 --- include/scsi/libsrp.h | 78 - {drivers/scsi/ibmvscsi => include/scsi}/viosrp.h | 13 +- 13 files changed, 5020 insertions(+), 548 deletions(-)
Quoted 8 lines
create mode 100644 drivers/scsi/ibmvscsi_tgt/Makefile
create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
create mode 100644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h
create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.c
create mode 100644 drivers/scsi/ibmvscsi_tgt/libsrp.h
delete mode 100644 drivers/scsi/libsrp.c
delete mode 100644 include/scsi/libsrp.h
rename {drivers/scsi/ibmvscsi => include/scsi}/viosrp.h (92%)This -v9 patch has been applied to target-pending/for-next here:
Note the deletion of drivers/scsi/libsrp.c + include/scsi/libsrp.h has been dropped from the above commit, as it looks like they where changes specific to your local tree.
Please have a quick look, and let me know if anything doesn't look right.
Hi Nic,
< SNIP >
Quoted 6 lines
Note the deletion of
drivers/scsi/libsrp.c+include/scsi/libsrp.hhas been dropped from the above commit, as it looks like they where changes specific to your local tree.Please have a quick look, and let me know if anything doesn't look right.
So the deletion is from James suggesting that I revert the deletion of libsrp to make It clear that the code used to exist in the kernel and that im bringing it back for this driver. Thus yeah you are right to not include it since those files don’t exist currently.
-Bryant
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Bryant G. Ly
Hi Nic,
< SNIP >
Quoted 3 lines
Note the deletion of
drivers/scsi/libsrp.c+include/scsi/libsrp.hhas been dropped from the above commit, as it looks like they where changes specific to your local tree.
Quoted 7 lines
Quoted 2 lines
Please have a quick look, and let me know if anything doesn't look right.
So the deletion is from James suggesting that I revert the deletion of libsrp to make It clear that the code used to exist in the kernel and that im bringing it back for this driver. Thus yeah you are right to not include it since those files don’t exist currently.
Thanks for the confirmation. It should get picked up for today's linux-next build by SFR & Co, so let's see if any build or merge issues come up.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html