From e45cda7c6662171ab19ac97a86ef8ceecfed95fa Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 2 Apr 2011 06:48:53 +0000 Subject: [PATCH] Reverted r3330 because it was committed before having been discussed. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3332 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/README | 65 ---------------------------------------------- srpt/src/ib_srpt.c | 29 +-------------------- 2 files changed, 1 insertion(+), 93 deletions(-) diff --git a/srpt/README b/srpt/README index fd36418b1..71f4df233 100644 --- a/srpt/README +++ b/srpt/README @@ -158,71 +158,6 @@ the disk names assigned on the SCST target ("disk01" in the example below): [8:0:0:0] disk SCST_FIO disk01 102 /dev/sdb -Target names ------------- - -The name assigned by the ib_srpt target driver to an SCST target is the node -GUID of a HCA in hexadecimal form with a colon after every fourth digit. The -HCA node GUIDs can be obtained via the ibv_devices command, the ibv_devinfo -command or via sysfs. An example: - -# ibv_devices - device node GUID - ------ ---------------- - mlx4_1 0002c9030003cca2 - mlx4_0 0002c9030005f34e - -# head /sys/devices/*/*/*/infiniband/*/node_guid -==> /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/infiniband/mlx4_0/node_guid <== -0002:c903:0005:f34e - -==> /sys/devices/pci0000:00/0000:00:1c.0/0000:05:00.0/infiniband/mlx4_1/node_guid <== -0002:c903:0003:cca2 - -Once the ib_srpt driver has been loaded there will be SCST targets available -with the HCA node GUID as name: - -# ls /sys/bus/scst_target/drivers/ib_srpt/0* -0002:c903:0003:cca2 0002:c903:0005:f34e - - -Session names -------------- - -The ib_srpt target driver uses the 128-bit SRP initiator port identifier for -the session name. This identifier is sent by the SRP initiator to the SRP -target via the SRP_LOGIN_REQ information unit. The Linux SRP initiator -(ib_srp) generates the initiator port identifier as follows: -- The first eight bytes are the identifier extension ('initiator_ext' parameter - specified in the login string echoed into the sysfs file 'add_target'). -- The last eight bytes are the GUID of the initiator HCA port used to - communicate with the target. - -An example: - -[ INITIATOR ] - -$ for f in /sys/devices/*/*/*/infiniband/*/ports/*/gids/0; do echo -f; cat $f | cut -c21-; done -/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/infiniband/mlx4_0/ports/1/gids/0 -0002:c903:0005:f34b -/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/infiniband/mlx4_0/ports/2/gids/0 -0002:c903:0005:f34c -/sys/devices/pci0000:00/0000:00:1c.0/0000:05:00.0/infiniband/mlx4_1/ports/1/gids/0 -0002:c903:0003:cca7 -/sys/devices/pci0000:00/0000:00:1c.0/0000:05:00.0/infiniband/mlx4_1/ports/2/gids/0 -0002:c903:0003:cca8 - -[ TARGET, after login ] - -$ ls /sys/bus/scst_target/drivers/ib_srpt/*/sessions -/sys/bus/scst_target/drivers/ib_srpt/0002:c903:0003:cca2/sessions: -0x00000000000000000002c9030003cca7 - -/sys/bus/scst_target/drivers/ib_srpt/0002:c903:0005:f34e/sessions: -0x00000000000000000002c9030005f34b - - High availability ----------------- diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 2c4be32f2..ea304ea3a 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -144,16 +144,6 @@ MODULE_PARM_DESC(use_port_guid_in_session_name, "Use target port ID in the SCST session name such that" " redundant paths between multiport systems can be masked."); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) \ - || defined(RHEL_MAJOR) && RHEL_MAJOR -0 <= 5 -static int use_node_guid_in_target_name; -#else -static bool use_node_guid_in_target_name; -#endif -module_param(use_node_guid_in_target_name, bool, 0444); -MODULE_PARM_DESC(use_node_guid_in_target_name, - "Use target node GUIDs of HCAs as SCST target names."); - static int srpt_get_u64_x(char *buffer, struct kernel_param *kp) { return sprintf(buffer, "0x%016llx", *(u64 *)kp->arg); @@ -3536,7 +3526,6 @@ static void srpt_add_one(struct ib_device *device) struct srpt_device *sdev; struct srpt_port *sport; struct ib_srq_init_attr srq_attr; - char tgt_name[24]; int i; TRACE_ENTRY(); @@ -3551,15 +3540,7 @@ static void srpt_add_one(struct ib_device *device) INIT_LIST_HEAD(&sdev->rch_list); spin_lock_init(&sdev->spinlock); - if (use_node_guid_in_target_name) { - snprintf(tgt_name, sizeof(tgt_name), "%04x:%04x:%04x:%04x", - be16_to_cpu(((__be16 *)&device->node_guid)[0]), - be16_to_cpu(((__be16 *)&device->node_guid)[1]), - be16_to_cpu(((__be16 *)&device->node_guid)[2]), - be16_to_cpu(((__be16 *)&device->node_guid)[3])); - sdev->scst_tgt = scst_register_target(&srpt_template, tgt_name); - } else - sdev->scst_tgt = scst_register_target(&srpt_template, NULL); + sdev->scst_tgt = scst_register_target(&srpt_template, NULL); if (!sdev->scst_tgt) { PRINT_ERROR("SCST registration failed for %s.", sdev->device->name); @@ -3882,14 +3863,6 @@ static int __init srpt_init_module(void) goto out; } - if (!use_node_guid_in_target_name) - PRINT_WARNING("%s", "Usage of HCA numbers as SCST target names " - "is deprecated and will be removed in one of the next " - "versions. It is strongly recommended to set " - "use_node_guid_in_target_name parameter in 1 and " - "update your SCST config file accordingly to use HCAs " - "GUIDs."); - #ifdef CONFIG_SCST_PROC ret = class_register(&srpt_class); if (ret) {