From: Bart Van Assche Subject: Re: [PATCH v4] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver Date: Fri, 10 Jun 2016 12:05:38 -0700 Message-ID: References: <1464409675.22249.237.camel@haakon3.risingtidesystems.com> <1465507614-29695-1-git-send-email-bryantly@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bn1bbn0100.outbound.protection.outlook.com ([157.56.111.100]:51598 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752130AbcFJTFu (ORCPT ); Fri, 10 Jun 2016 15:05:50 -0400 In-Reply-To: <1465507614-29695-1-git-send-email-bryantly@linux.vnet.ibm.com> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: "Bryant G. Ly" , nab@linux-iscsi.org, hch@infradead.org Cc: mikecyr@linux.vnet.ibm.com, James.Bottomley@HansenPartnership.com, tyreld@linux.vnet.ibm.com, brking@linux.vnet.ibm.com, akpm@linux-foundation.org, bart.vanassche@sandisk.com, gregkh@linuxfoundation.org, joe@perches.com, seroyer@linux.vnet.ibm.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, martin.petersen@oracle.com On 06/09/2016 02:26 PM, Bryant G. Ly wrote: > 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). > +#include Does this driver create kernel threads? Is inclusion of this header file needed? > +#include We do not want #if LINUX_VERSION_CODE < KERNEL_VERSION(...) statements in upstream code so please leave this #include and the version tests out. > +/** > + * 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; > + 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.