ib_srpt: initial .40-rc1 drivers/infiniband/ulp/srpt merge
Subsystems (3)
RFC 1/1 ib_srpt: initial .40-rc1 drivers/infiniband/ulp/srpt merge
From: Nicholas Bellinger <[email protected]>
Hi Roland, Bart and Co,
This patch adds the kernel module ib_srpt SCSI RDMA Protocol (SRP) target implementation conforming to the SRP r16a specification.
This driver was originally developed by Vu Pham and has been optimized by Bart Van Assche and merged into upstream LIO based on his srpt-lio-4.1 branch here:
https://github.com/bvanassche/srpt-lio/commits/srpt-lio-4.1/
This updated patch also contains the following two changes from lio-core-2.6.git/lio-4.1. One is to fix a bug with 1 >= task->task_sg[] chained mappings in ib_srpt, and the other to convert the configfs control plane to reference IB Port GUID and struct srpt_port directly following mainline v4.0 target_core_fabric_configfs.c convertion for ib_srpt to work with rtslib/rtsadmin v2 code.
These seperate patches can be found here:
ib_srpt: Fix bug with chainged SGLs in srpt_map_sg_to_ib_sge
http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=commitdiff;h=ea485147563b6555a97dbf811825fbb586519252
ib_srpt: Convert se_wwn endpoint reference to struct srpt_port->port_wwn
http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=commitdiff;h=4e544a210acb227df1bb4ca5086e65bdf4e648ea
Note that this series requires the following four part patch series for mainline target core in order to function, which are currently in James's scsi-misc queue, which can be found here:
[PATCH-v2 0/4] Bugfixes for .39-rc8
http://marc.info/?l=linux-scsi&m=130514011321906&w=2
Also for convenience, this patch along with the proper mainline target core patches above are directly here @ .39-rc7:
git://git.kernel.org/pub/scm/linux/kernel/git/nab/scsi-post-merge-2.6.git for-40-ib_srpt
Please review+consider for an initial merge, and thanks to Bart Van Assche for his efforts to forward port driver to mainline target v4 infrastructure.
Bart, can you please review the changes and add your signoff if you are OK with the bugfix and control plane rework..?
Thanks everyone,
--- drivers/infiniband/Kconfig | 1 + drivers/infiniband/Makefile | 1 + drivers/infiniband/ulp/srpt/Kconfig | 12 + drivers/infiniband/ulp/srpt/Makefile | 2 + drivers/infiniband/ulp/srpt/ib_dm_mad.h | 139 ++ drivers/infiniband/ulp/srpt/ib_srpt.c | 4001 +++++++++++++++++++++++++++++++ drivers/infiniband/ulp/srpt/ib_srpt.h | 409 ++++ 7 files changed, 4565 insertions(+), 0 deletions(-) create mode 100644 drivers/infiniband/ulp/srpt/Kconfig create mode 100644 drivers/infiniband/ulp/srpt/Makefile create mode 100644 drivers/infiniband/ulp/srpt/ib_dm_mad.h create mode 100644 drivers/infiniband/ulp/srpt/ib_srpt.c create mode 100644 drivers/infiniband/ulp/srpt/ib_srpt.h
drivers/infiniband/Kconfig +1 -0
@@ -54,6 +54,7 @@ source "drivers/infiniband/hw/nes/Kconfig" source "drivers/infiniband/ulp/ipoib/Kconfig" source "drivers/infiniband/ulp/srp/Kconfig" +source "drivers/infiniband/ulp/srpt/Kconfig" source "drivers/infiniband/ulp/iser/Kconfig"
drivers/infiniband/Makefile +1 -0
@@ -10,4 +10,5 @@ obj-$(CONFIG_MLX4_INFINIBAND) += hw/mlx4/ obj-$(CONFIG_INFINIBAND_NES) += hw/nes/ obj-$(CONFIG_INFINIBAND_IPOIB) += ulp/ipoib/ obj-$(CONFIG_INFINIBAND_SRP) += ulp/srp/ +obj-$(CONFIG_INFINIBAND_SRPT) += ulp/srpt/ obj-$(CONFIG_INFINIBAND_ISER) += ulp/iser/
drivers/infiniband/ulp/srpt/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +config INFINIBAND_SRPT + tristate "InfiniBand SCSI RDMA Protocol target support" + depends on INFINIBAND && TARGET_CORE + ---help--- + + Support for the SCSI RDMA Protocol (SRP) Target driver. The + SRP protocol is a protocol that allows an initiator to access + a block storage device on another host (target) over a network + that supports the RDMA protocol. Currently the RDMA protocol is + supported by InfiniBand and by iWarp network hardware. More + information about the SRP protocol can be found on the website + of the INCITS T10 technical committee (http://www.t10.org/).
drivers/infiniband/ulp/srpt/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +ccflags-y := -Idrivers/target +obj-$(CONFIG_INFINIBAND_SRPT) += ib_srpt.o
drivers/infiniband/ulp/srpt/ib_dm_mad.h new file +139 -0
139 lines not on this page · raw message
drivers/infiniband/ulp/srpt/ib_srpt.c new file +4001 -0
2,835 lines not on this page · raw message
drivers/infiniband/ulp/srpt/ib_srpt.h new file +409 -0
409 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.5.1
Part of the diff is not shown here. View the raw message.
Quoted 1 line
+ccflags-y := -Idrivers/target
Why do you need the ccflags? Everything needed should be under include/target, and if not that needs to be fixed.
drivers/infiniband/ulp/srpt/ib_srpt.c line 44
Quoted 5 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +5
-0+#include <linux/kthread.h> +#include <linux/string.h> +#include <linux/delay.h> +#include <linux/atomic.h> +#include <scsi/libsas.h> /* TASK_ATTR_* */
We really need to stop spreading that include. Care to submit a patch for .40 to move the TASK_ATTR_* defines to scsi/scsi.h?
drivers/infiniband/ulp/srpt/ib_srpt.c line 148
Quoted 9 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +9
-0+/** +* srpt_sdev_name() - Return the name associated with the HCA. +* +* Examples are ib0, ib1, ... +*/ +static inline const char *srpt_sdev_name (struct srpt_device *sdev) +{ +return sdev->device->name; +}
Does this really need a helper?
drivers/infiniband/ulp/srpt/ib_srpt.c line 159
Quoted 11 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +11
-0+ +static enum rdma_ch_state srpt_get_ch_state (struct srpt_rdma_ch *ch) +{ +unsigned long flags; +enum rdma_ch_state state; + +spin_lock_irqsave (&ch->spinlock, flags); + state = ch->state; +spin_unlock_irqrestore (&ch->spinlock, flags); +return state; +}
Given that the channel is a 32-bit value taking a lock over reading it doesn't help anything. If you need any kind of exclusion it needs to be held over the actual use of it, else it can be dropped.
drivers/infiniband/ulp/srpt/ib_srpt.c line 172
Quoted 12 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +12
-0+static enum rdma_ch_state +srpt_set_ch_state (struct srpt_rdma_ch *ch,enum rdma_ch_state new_state) +{ +unsigned long flags; +enum rdma_ch_state prev; + +spin_lock_irqsave (&ch->spinlock, flags); + prev = ch->state; + ch->state = new_state; +spin_unlock_irqrestore (&ch->spinlock, flags); +return prev; +}
The oly caller of this does a spin_lock_irq so I assume it's from process context. So this one could do the same. It would be good idea to check what kind of action is done from irq context at all and document what data structures / critical sections can be access from there.
drivers/infiniband/ulp/srpt/ib_srpt.c line 248
Quoted 7 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +7
-0+/** +* srpt_srq_event() - SRQ event callback function. +*/ +static void srpt_srq_event (struct ib_event *event,void *ctx) +{ +printk (KERN_INFO "SRQ event %d\n" , event->event); +}
Is this overly useful?
drivers/infiniband/ulp/srpt/ib_srpt.c line 750
Quoted 11 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +11
-0+static enum srpt_command_state srpt_get_cmd_state (struct srpt_send_ioctx *ioctx) +{ +enum srpt_command_state state; +unsigned long flags; + +BUG_ON (!ioctx); + +spin_lock_irqsave (&ioctx->spinlock, flags); + state = ioctx->state; +spin_unlock_irqrestore (&ioctx->spinlock, flags); +return state;
Same comment about reading a variable as above.
drivers/infiniband/ulp/srpt/ib_srpt.c line 1683
Quoted 8 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +8
-0+/* +* srpt_unpack_lun() - Convert from network LUN to linear LUN. +* +* Convert an 2-byte, 4-byte, 6-byte or 8-byte LUN structure in network byte +* order (big endian) to a linear LUN. Supports three LUN addressing methods: +* peripheral, flat and logical unit. See also SAM-2, section 4.9.4 (page 40). +*/ +static uint64_t srpt_unpack_lun (const uint8_t *lun,int len)
Nick, didn't you plan to take the LUN addressing to the core? After all it's not a transport specific format.
drivers/infiniband/ulp/srpt/ib_srpt.c line 2143
Quoted 11 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +11
-0+static int srpt_compl_thread (void *arg) +{ +struct srpt_rdma_ch *ch; + +/* Hibernation / freezing of the SRPT kernel thread is not supported. */ + current->flags |=PF_NOFREEZE ; + + ch = arg; +BUG_ON (!ch); +printk (KERN_INFO "Session %s: kernel thread %s (PID %d) started\n" , + ch->sess_name, ch->thread->comm, current->pid);
Can we please kill all these verbose printks? I know the target core does them, but that needs to be fixed to. If you really care for debugging you can trivially trace it using the function tracer.
drivers/infiniband/ulp/srpt/ib_srpt.c line 2148
Quoted 5 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +5
-0+while (!kthread_should_stop ()) { +wait_event_interruptible (ch->wait_queue, + (srpt_process_completion (ch->cq, ch), +kthread_should_stop ())); + }
Instead of doing a wait_event_interruptible in a kthread you can just do a schedule() in interruptible context and use wake_up_process to wake it up.
Quoted 1 line
+#include <
linux/version.h>
Shouldn't be needed.
drivers/infiniband/ulp/srpt/ib_srpt.h line 135
Quoted 6 lines
drivers/infiniband/ulp/srpt/ib_srpt.h new file +6
-0+static inline u64 encode_wr_id (u8 opcode,u32 idx) +{return ((u64 )opcode <<32 ) | idx; } +static inline u8 opcode_from_wr_id (u64 wr_id) +{return wr_id >>32 ; } +static inline u32 idx_from_wr_id (u64 wr_id) +{return (u32 )wr_id; }
Please fix the indentation.
Quoted 2 lines
We really need to stop spreading that include. Care to submit a patch for .40 to move the TASK_ATTR_* defines to
scsi/scsi.h?
Sounds simple enough even for me to do. I'll send one in a little bit...
- R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Bart Van Assche
maintainerQuoted 2 lines · Nicholas A. Bellinger
ib_srpt: Convertse_wwnendpoint reference to structsrpt_port->port_wwn
http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=commitdiff;h=4e544a210acb227df1bb4ca5086e65bdf4e648ea
Why has that change been implemented ? As far as I know InfiniBand HCAs have either one or two ports. If there are two ports present, at most one is active at any time. I don't see the point of making individual ports visible and configurable in configfs on the target instead of the HCA. If a user enables one port of a HCA but not the other, that could result in some really strange and hard to diagnose failures if the IB subnet manager decides to switch over to the other port. Or am I missing something ?
Bart.
Quoted 2 lines · Bart Van Assche
As far as I know InfiniBand HCAs have either one or two ports. If there are two ports present, at most one is active at any time.
This is not true, many installations run dual rail IB with a desire for both ports to be active and handling traffic at once. Not sure how this translates to SRPT, but a good goal would be for a SRPT target to be available on both HCA ports and support APM between them, at the discretion of the client.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Bart Van Assche
maintainerQuoted 10 lines · Jason Gunthorpe
Quoted 2 lines · Bart Van Assche
As far as I know InfiniBand HCAs have either one or two ports. If there are two ports present, at most one is active at any time.
This is not true, many installations run dual rail IB with a desire for both ports to be active and handling traffic at once. Not sure how this translates to SRPT, but a good goal would be for a SRPT target to be available on both HCA ports and support APM between them, at the discretion of the client.
Thanks for the feedback. I'm still wondering though about the usefulness of disabling / enabling SRPT per HCA port. For the use cases I know about SRP communication over all target ports will be enabled as soon as target configuration has finished and more fine-grained access configuration will occur by allowing/disallowing certain initiators to log in.
Bart.
Quoted 6 lines · Bart Van Assche
Thanks for the feedback. I'm still wondering though about the usefulness of disabling / enabling SRPT per HCA port. For the use cases I know about SRP communication over all target ports will be enabled as soon as target configuration has finished and more fine-grained access configuration will occur by allowing/disallowing certain initiators to log in.
I definitely think that allowing the flexibility to configure ports individually is required. It's easy to imagine a case with a separate front-end and back-end networks on the two HCA ports (this would be a pretty normal ethernet config), where only one port should be a target port.
It may not be how people do things now but it should at least be possible.
- R.
Quoted 8 lines · Roland Dreier
Quoted 6 lines · Bart Van Assche
Thanks for the feedback. I'm still wondering though about the usefulness of disabling / enabling SRPT per HCA port. For the use cases I know about SRP communication over all target ports will be enabled as soon as target configuration has finished and more fine-grained access configuration will occur by allowing/disallowing certain initiators to log in.
Quoted 7 lines
I definitely think that allowing the flexibility to configure ports individually is required. It's easy to imagine a case with a separate front-end and back-end networks on the two HCA ports (this would be a pretty normal ethernet config), where only one port should be a target port.
It may not be how people do things now but it should at least be possible.
Hey guys,
Apologies for the slightly delay response here.. Just to clarify on Bart's point above. The srpt_port->port_wwn patch in question does current ensure that sport->enabled has been set via an configfs attribute at:
/sys/kernel/config/target/srpt/$IB_PORT_GUID/tpgt_1/enable
and will reject all SRP login attempts to an individual struct srpt_port until the attribute has been explictly triggered.
This allows ib_srpt to follow what is expected by rtsadmin-v2 + lio-utils, and used to generate /etc/target/srpt_start.sh used to save persistent fabric configuration. Currently other fabrics like iscsi-target and tcm_qla2xxx expect to be able to reject fabric login requests before the full set of WWPN endpoints, LUNs, NodeACLs + MappedLUNs have been recreated during an typical init.d/target start operation.
I think it makes sense to do the same for the SRPT control plane on an individual HCA port GUID basis as long as there are no underlying fabric issues, and that Roland is happy. In terms of supporting more than one type of /sys/kernel/config/target/srpt/$WWPN/$TPGT/ layout, I would really like to avoid this for mainline code unless there is a really good reason..
Also, I think ib_srpt needs to properly support 'demo-mode' operation in /var/target/fabric/ib_srpt.spec as this is very useful for testing and development purposes. I go ahead and get this added to upstream LIO v4.1 in the next days and respin for mainline with Hch's review + Bart's changes.
Thanks folks,
--nab
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · Christoph Hellwig
Quoted 1 line
+ccflags-y := -Idrivers/target
Why do you need the ccflags? Everything needed should be under
include/target, and if not that needs to be fixed.
Quoted 9 lines
drivers/infiniband/ulp/srpt/ib_srpt.c line 44
Quoted 5 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +5
-0+#include <linux/kthread.h> +#include <linux/string.h> +#include <linux/delay.h> +#include <linux/atomic.h> +#include <scsi/libsas.h> /* TASK_ATTR_* */ We really need to stop spreading that include. Care to submit a patch for .40 to move the TASK_ATTR_* defines to
scsi/scsi.h?
Agreed, this conversion is definately over-due for target-core.
Pushing this change now in lio-4.1 to use scsi_tcq.h for LIO upstream fabric modules tcm_loop, iscsi-target, tcm_fc, ibmvscsis, qla2xxx, ib_srpt, and tcm_vhost:
commit 53076ba5838d9653e273c3e43b76fd8220e459a4
Author: Nicholas Bellinger <[email protected]> Date: Wed May 18 22:24:05 2011 -0700
target: Convert TASK_ATTR to scsi_tcq.h definitions
commit ffee1a685bc083b4c0984230affac6b434b1ea4c
Author: Nicholas Bellinger <[email protected]> Date: Wed May 18 22:41:31 2011 -0700
ibmvscsis: Convert TASK_ATTR to scsi_tcq.h definitions
I will get this queued against scsi-misc for .40 with tcm_loop+tcm_fc bits for tomorrow & respin a fresh iscsi-target pull as well.
Quoted 12 lines
drivers/infiniband/ulp/srpt/ib_srpt.c line 148
Quoted 9 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +9
-0+/** +* srpt_sdev_name() - Return the name associated with the HCA. +* +* Examples are ib0, ib1, ... +*/ +static inline const char *srpt_sdev_name (struct srpt_device *sdev) +{ +return sdev->device->name; +}Does this really need a helper?
Not sure..
Quoted 7 lines
Quoted 7 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +7
-0+ +static enum rdma_ch_state srpt_get_ch_state (struct srpt_rdma_ch *ch) +{ +unsigned long flags; +enum rdma_ch_state state; + +spin_lock_irqsave (&ch->spinlock, flags);
Quoted 9 lines
drivers/infiniband/ulp/srpt/ib_srpt.c line 159
Quoted 4 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +4
-0+ state = ch->state; +spin_unlock_irqrestore (&ch->spinlock, flags); +return state; +}Given that the channel is a 32-bit value taking a lock over reading it doesn't help anything. If you need any kind of exclusion it needs to be held over the actual use of it, else it can be dropped.
Mmm, looks like it's safe to drop. Bart..?
Quoted 10 lines
Quoted 10 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +10
-0+static enum rdma_ch_state +srpt_set_ch_state (struct srpt_rdma_ch *ch,enum rdma_ch_state new_state) +{ +unsigned long flags; +enum rdma_ch_state prev; + +spin_lock_irqsave (&ch->spinlock, flags); + prev = ch->state; + ch->state = new_state; +spin_unlock_irqrestore (&ch->spinlock, flags);
Quoted 9 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ return prev; +}The oly caller of this does a
spin_lock_irqso I assume it's from process context. So this one could do the same. It would be good idea to check what kind of action is done from irq context at all and document what data structures / critical sections can be access from there.
IB folks..?
Quoted 10 lines
drivers/infiniband/ulp/srpt/ib_srpt.c line 248
Quoted 7 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +7
-0+/** +* srpt_srq_event() - SRQ event callback function. +*/ +static void srpt_srq_event (struct ib_event *event,void *ctx) +{ +printk (KERN_INFO "SRQ event %d\n" , event->event); +}Is this overly useful?
IB folks..?
Quoted 5 lines
Quoted 5 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +5
-0+static enum srpt_command_state srpt_get_cmd_state (struct srpt_send_ioctx *ioctx) +{ +enum srpt_command_state state; +unsigned long flags; +
Quoted 9 lines
drivers/infiniband/ulp/srpt/ib_srpt.c line 750
Quoted 6 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +6
-0+BUG_ON (!ioctx); + +spin_lock_irqsave (&ioctx->spinlock, flags); + state = ioctx->state; +spin_unlock_irqrestore (&ioctx->spinlock, flags); +return state;Same comment about reading a variable as above.
Bart..?
Quoted 12 lines
drivers/infiniband/ulp/srpt/ib_srpt.c line 1683
Quoted 8 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +8
-0+/* +* srpt_unpack_lun() - Convert from network LUN to linear LUN. +* +* Convert an 2-byte, 4-byte, 6-byte or 8-byte LUN structure in network byte +* order (big endian) to a linear LUN. Supports three LUN addressing methods: +* peripheral, flat and logical unit. See also SAM-2, section 4.9.4 (page 40). +*/ +static uint64_t srpt_unpack_lun (const uint8_t *lun,int len)Nick, didn't you plan to take the LUN addressing to the core? After all it's not a transport specific format.
Yes, this should be using scsilun_to_int(), but in current mainline code these is still required to load. The iscsi-target PATCH-v4 series patch containing this fix wrt to REPORT_LUNs needs to go into mainline before this can be fixed..
[PATCH-v4 03/14] target: Convert REPORT_LUNs to use int_to_scsilun
http://marc.info/?l=linux-scsi&m=130561442821080&w=2
Will get this converted in ib_srpt for lio-4.1 for now..
Quoted 7 lines
Quoted 7 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +7
-0+static int srpt_compl_thread (void *arg) +{ +struct srpt_rdma_ch *ch; + +/* Hibernation / freezing of the SRPT kernel thread is not supported. */ + current->flags |=PF_NOFREEZE ; +
Quoted 9 lines
drivers/infiniband/ulp/srpt/ib_srpt.c line 2143
Quoted 4 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +4
-0+ ch = arg; +BUG_ON (!ch); +printk (KERN_INFO "Session %s: kernel thread %s (PID %d) started\n" , + ch->sess_name, ch->thread->comm, current->pid);Can we please kill all these verbose printks? I know the target core does them, but that needs to be fixed to. If you really care for debugging you can trivially trace it using the function tracer.
Ugh yes, this still needs to be addressed properly for target core..
Quoted 10 lines
drivers/infiniband/ulp/srpt/ib_srpt.c line 2148
Quoted 5 lines
drivers/infiniband/ulp/srpt/ib_srpt.c new file +5
-0+while (!kthread_should_stop ()) { +wait_event_interruptible (ch->wait_queue, + (srpt_process_completion (ch->cq, ch), +kthread_should_stop ())); + }Instead of doing a
wait_event_interruptiblein a kthread you can just do aschedule()in interruptible context and usewake_up_processto wake it up.
This conversion looks reasonable to me, and will get this resolved for the next round.
Thanks for your review Christoph!
--nab
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Bart Van Assche
maintainerQuoted 17 lines · Nicholas A. Bellinger
The
srpt_port->port_wwnpatch in question does current ensure thatsport->enabledhas been set via an configfs attribute at:
/sys/kernel/config/target/srpt/$IB_PORT_GUID/tpgt_1/enableand will reject all SRP login attempts to an individual struct
srpt_portuntil the attribute has been explictly triggered.This allows
ib_srptto follow what is expected by rtsadmin-v2 + lio-utils, and used to generate/etc/target/srpt_start.shused to save persistent fabric configuration. Currently other fabrics like iscsi-target andtcm_qla2xxxexpect to be able to reject fabric login requests before the full set of WWPN endpoints, LUNs, NodeACLs + MappedLUNs have been recreated during an typical init.d/target start operation.
Quoted 6 lines
I think it makes sense to do the same for the SRPT control plane on an individual HCA port GUID basis as long as there are no underlying fabric issues, and that Roland is happy. In terms of supporting more than one type of
/sys/kernel/config/target/srpt/$WWPN/$TPGT/layout, I would really like to avoid this for mainline code unless there is a really good reason..
I'm still wondering whether it was a good idea to switch from ib<n> style names to port GIDs. Not only will that make it hard for users to match the ib<n> names already assigned to InfiniBand HCAs with target port names but this also deviates from the naming scheme used for any other Linux device. Ethernet devices e.g. appear as eth<n> in /dev instead of a MAC address like 00:1a:64:10:18:6f.
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Bart Van Assche
I'm still wondering whether it was a good idea to switch from ib<n> style names to port GIDs. Not only will that make it hard for users to match the ib<n> names already assigned to InfiniBand HCAs with target port names but this also deviates from the naming scheme used for any other Linux device. Ethernet devices e.g. appear as eth<n> in /dev instead of a MAC address like 00:1a:64:10:18:6f.
The ib# names returned by ip addr are already disjoint from the namespace that is being used by SRP targets. The only choices are port GUID or something like mlx4_0/1, the later is somewhat less commonly used..
Is there some approach here for selecting the pkey as well?
Jason
Bart Van Assche
maintainerQuoted 5 lines · Jason Gunthorpe
Many installations run dual rail IB with a desire
for both ports to be active and handling traffic at once. Not sure how this translates to SRPT, but a good goal would be for a SRPT target to be available on both HCA ports and support APM between them, at the discretion of the client.
Regarding APM: the Linux kernel already has multipath support and duplicate functionality is in general not welcomed. So you will have to come up with a very good reason before APM support in ib_srp or ib_srpt would be considered for acceptance.
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Bart Van Assche
Regarding APM: the Linux kernel already has multipath support and duplicate functionality is in general not welcomed. So you will have to come up with a very good reason before APM support in
ib_srporib_srptwould be considered for acceptance.
APM is a feature of IB's tranport layerthat provides disruption free lossless failover to a backup network path completely transparently to the application (eg SRP in this case).
This plays a similar role in the IB stack to the realtime spanning tree protocol that ethernet uses, or the multipath IP routing that is already in the net stack. I don't see it duplicating SCSI multipath at all. On very large IB networks (eg > 1000 switches) the rate of link failures is high enough that taking an application level recovery on hundreds of nodes due to a link failure is troublesome.
If ib_srpt is implemented properly it may already support APM because APM is supported by the IB CM that it relies on to setup connections, and any SRP client could already request APM functionality during connection setup.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Bart Van Assche
maintainerQuoted 17 lines · Jason Gunthorpe
Quoted 4 lines · Bart Van Assche
Regarding APM: the Linux kernel already has multipath support and duplicate functionality is in general not welcomed. So you will have to come up with a very good reason before APM support in
ib_srporib_srptwould be considered for acceptance.APM is a feature of IB's tranport layerthat provides disruption free lossless failover to a backup network path completely transparently to the application (eg SRP in this case).
This plays a similar role in the IB stack to the realtime spanning tree protocol that ethernet uses, or the multipath IP routing that is already in the net stack. I don't see it duplicating SCSI multipath at all. On very large IB networks (eg > 1000 switches) the rate of link failures is high enough that taking an application level recovery on hundreds of nodes due to a link failure is troublesome.
Quoted 4 lines
If
ib_srptis implemented properly it may already support APM because APM is supported by the IB CM that it relies on to setup connections, and any SRP client could already request APM functionality during connection setup.
My reply applies to your original statement where you were referring to APM with different destination ports. What you write above is about APM with identical destination ports and hence does not apply to my reply.
Bart.
Quoted 4 lines · Bart Van Assche
My reply applies to your original statement where you were referring to APM with different destination ports. What you write above is about APM with identical destination ports and hence does not apply to my reply.
The subnet manager can give an APM result that will switch between ports on the same node, APM handles both switching to a different path with the same end ports, and also switching to a new path using the same end ports. An implementation supporting APM must be ready for both situations - realistically no additional app code is required to support the multiport case since it falls out for free. You'd actually have to actively work to prevent it...
This is why in the IB verbs architecture nearly everything is tied to a *device*, not a port.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 26 lines · Bart Van Assche
Quoted 17 lines · Nicholas A. Bellinger
The
srpt_port->port_wwnpatch in question does current ensure thatsport->enabledhas been set via an configfs attribute at:
/sys/kernel/config/target/srpt/$IB_PORT_GUID/tpgt_1/enableand will reject all SRP login attempts to an individual struct
srpt_portuntil the attribute has been explictly triggered.This allows
ib_srptto follow what is expected by rtsadmin-v2 + lio-utils, and used to generate/etc/target/srpt_start.shused to save persistent fabric configuration. Currently other fabrics like iscsi-target andtcm_qla2xxxexpect to be able to reject fabric login requests before the full set of WWPN endpoints, LUNs, NodeACLs + MappedLUNs have been recreated during an typical init.d/target start operation.Quoted 6 lines
I think it makes sense to do the same for the SRPT control plane on an individual HCA port GUID basis as long as there are no underlying fabric issues, and that Roland is happy. In terms of supporting more than one type of
/sys/kernel/config/target/srpt/$WWPN/$TPGT/layout, I would really like to avoid this for mainline code unless there is a really good reason..
Quoted 7 lines
I'm still wondering whether it was a good idea to switch from ib<n> style names to port GIDs. Not only will that make it hard for users to match the ib<n> names already assigned to InfiniBand HCAs with target port names but this also deviates from the naming scheme used for any other Linux device. Ethernet devices e.g. appear as eth<n> in /dev instead of a MAC address like 00:1a:64:10:18:6f.
So from the user perspective in rtsadmin/rtslib, the Port GUIDs are automatically presented in long-form after being extracted and parsed from /sys/class/infiniband/*/ports/*/gids/0 input via ib_srpt.spec here:
http://www.linux-iscsi.org/wiki/SCSI_RDMA_Protocol/RTSadmin#Specification_file
The available IB Port GUIs appear as <TAB> completable input in /ib_srpt/ during a 'create wwn=' operation shown here:
http://www.linux-iscsi.org/wiki/SCSI_RDMA_Protocol/RTSadmin#Configuration
There is no reason why we can't present a more verbose informational display based on individual available HW fabric WWPNs. Eg: things like HW port status information, driver, firmware rev, etc..
So aside from the user side of things, I think using a IB Port GUID makes more sense to ensure that /sys/kernel/config/target/srpt/ configuration does not depend upon the ordering of symbolic HCA names in /sys/class/infiniband/, which AFAIK are not guarenteed to be persistent as HCAs are added/removed from the system.
Ensuring that we can reference target fabric WWPNs using an underlying HW reference instead of a symbolic name is important for this reason, and is currently how other HW target mode drivers including tcm_fc(openfcoe) currently function.
Thanks,
--nab
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Bart Van Assche
maintainerQuoted 2 lines · Jason Gunthorpe
This is why in the IB verbs architecture nearly everything is tied to a *device*, not a port.
LIO has a feature called "access control lists" that allows to define which initiators are allowed to log in to a target. For a single-rail HCA it makes most sense to configure that information per HCA. For a dual-rail HCA the most flexible approach is to allow the user to configure ACLs per HCA port. That made me wonder whether it is possible to find out from software whether a dual-port HCA is single-rail or dual-rail. A quick glance at struct ib_device_attr and struct ib_port_attr in <rdma/ib_verbs.h> didn't yield any field usable for this purpose. Did I overlook something ?
Bart.