Re: [PATCH v4] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <linux/kthread.h>

Does this driver create kernel threads? Is inclusion of this header file needed?

+#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.

+/**
+ * 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux