User Tools

Site Tools


nndocs:srp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
nndocs:srp [2025/02/24 19:08] – massively improve, though it still doesn't work naptasticnndocs:srp [2025/12/24 02:45] (current) – [Configuration] clarify naptastic
Line 12: Line 12:
 Now strip the first 4 bytes off (they change anyway) and remove the :'s Now strip the first 4 bytes off (they change anyway) and remove the :'s
  
-  /srpt> ib.fe800000000000005849560e53b70b01/acls create ib.fe800000000000005849560e59150301 +  fe800000000000005849560e59150301 
-  Created Node ACL for ib.fe800000000000005849560e59150301+ 
 +Initiator ACLs start with all 0's. Targets start with fe80. 
 + 
 +  /srpt> ib.fe800000000000005849560e53b70b01/acls create ib.00000000000000005849560e59150301 
 +  Created Node ACL for ib.00000000000000005849560e59150301
   Created mapped LUN 0.   Created mapped LUN 0.
 +
 +A Linux SRP target is always visible from all InfiniBand partitions.
  
 ====Dependencies==== ====Dependencies====
Line 20: Line 26:
   apt install srptools   apt install srptools
  
-===Login fails===+Do **NOT** set srp_daemon loose without using the -o flag! It will flood dmesg on both the initiator and the target! 
 + 
 +Find targets to connect to: 
 + 
 +    # srp_daemon -o -v -c -p 1 
 + 
 +  * -o means "run once" otherwise dmesg on all your hosts will get polluted with SRP login noise. 
 +  * -v means "say what you're doing" 
 +  * -c means "emit target information in a format we can use later" 
 +  * -p 1 means "only scan on HCA port 1" so obviously change this if you are initiating from port 2... 
 + 
 +====Configuration==== 
 + 
 +It is **critical** that you edit /etc/srp_daemon.conf as soon as you have a list of targets and disallow connections to anything except the targets you want. The default file is well commented.
  
-shark (initiator):+To connect to a target listed by srp_daemon, write it to the appropriate add_target file in /sys/class/infiniband_srp. Here's how shark gets its swap ramdisk from southpark:
  
-   [74794.509035] scsi host11ib_srpREJ received +  [root]@[shark][~]# echo 'id_ext=5849560e53b70b01,ioc_guid=5849560e53b70b01,dgid=fe800000000000005849560e53b70b01,pkey=ffff,service_id=5849560e53b70b01' > \ 
-   [74794.509038] scsi host11: ib_srp: SRP LOGIN from fe80:0000:0000:0000:5849:560e:5915:0301 to fe80:0000:0000:0000:5849:560e:53b7:0b09 REJECTEDreason 0x00010001 +  /sys/class/infiniband_srp/srp-ibp14s0f0-1/add_target 
-   [74794.509048scsi host11ib_srpConnection 0/12 to fe80:0000:0000:0000:5849:560e:53b7:0b09 failed+  [root]@[shark][~]# dmesg 
 +    (...snip...) 
 +  [2719206.378801] scsi host8SRP.T10:5849560E53B70B01 
 +  [2719206.379439] scsi 8:0:0:0: Direct-Access     LIO-ORG  swap             4.0  PQ: 0 ANSI: 6 
 +  [2719206.380206] sd 8:0:0:0: Attached scsi generic sg5 type 0 
 +  [2719206.380337] sd 8:0:0:0: [sdd] 33554432 512-byte logical blocks: (17.2 GB/16.0 GiB) 
 +  [2719206.380376] scsi host8: ib_srp: new target: id_ext 5849560e53b70b01 ioc_guid 5849560e53b70b01 pkey ffff service_id 5849560e53b70b01 sgid fe80:0000:0000:0000:5849:560e:5915:0301 dgid fe80:0000:0000:0000:5849:560e:53b7:0b01 
 +  [2719206.380380] sd 8:0:0:0: [sdd] Write Protect is off 
 +  [2719206.380384] sd 8:0:0:0: [sdd] Mode Sense: 43 00 00 08 
 +  [2719206.380452] sd 8:0:0:0: [sdd] Write cache: disabledread cache: enabled, doesn't support DPO or FUA 
 +  [2719206.395027sd 8:0:0:0: [sdd] Preferred minimum I/O size 512 bytes 
 +  [2719206.395030] sd 8:0:0:0[sdd] Optimal transfer size 4294967288 logical blocks > dev_max (65535 logical blocks) 
 +  [2719206.425809] sd 8:0:0:0: [sdd] Attached SCSI disk
  
-southpark (target):+Lazy benchmarking seems good:
  
-   [4483481.918835ib_srpt Received SRP_LOGIN_REQ with i_port_id 5849:560e:53b7:0b09:5849:560e:5915:0301, t_port_id 5849:560e:53b7:0b01:5849:560e:53b7:0b01 and it_iu_len 8260 on port 1 (guid=fe80:0000:0000:0000:5849:560e:53b7:0b09); pkey 0xb068 +  [root]@[shark][~]# dd if=/dev/sdb of=/dev/null bs=4M 
-   [4483481.945664] ib_srpt rejected SRP_LOGIN_REQ because target port ibp33s0f1_1 has not yet been enabled +  4096+0 records in 
-   [4483481.959142] ib_srpt Rejecting login with reason 0x10001+  4096+0 records out 
 +  17179869184 bytes (17 GB, 16 GiB) copied, 5.38771 s, 3.2 GB/s 
 +   
 +  [root]@[shark][~]# dd if=/dev/zero of=/dev/sdb bs=4M 
 +  dderror writing '/dev/sdb'No space left on device 
 +  4097+0 records in 
 +  4096+0 records out 
 +  17179869184 bytes (17 GB, 16 GiBcopied, 13.7431 s, 1.3 GB/s
  
-"port has not yet been enabled" according to the source code, checks the HCA port itself if its enabled. I think the value isn't being curried correctly somewhere, because:+====Logout====
  
-  [root]@[southpark][/sys/kernel/config/target/srpt/0xfe800000000000005849560e53b70b01/tpgt_1]# cat enable  +"Delete the port" sounds pretty destructive, but this actually is the graceful way to close the connection.
-  1+
  
 +  # echo 1 > /sys/class/srp_remote_ports/ [tab tab tab] /delete
nndocs/srp.1740424131.txt.gz · Last modified: 2025/02/24 19:08 by naptastic