All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
To: Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Amir Vadai <amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Chien Yen <chien.yen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Dominique Martinet
	<dominique.martinet-KCE40YydGKI@public.gmane.org>,
	Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Eric Van Hensbergen
	<ericvh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Ido Shamay <idos-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Latchesar Ionkov <lucho-OnYtXJJ0/fesTnJN9+BGXg@public.gmane.org>,
	Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Roi Dayan <roid-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Ron Minnich <rminnich-4OHPYypu0djtX7QSmKvirg@public.gmane.org>,
	Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Simon Derr <simon.derr-6ktuUTfB/bM@public.gmane.org>,
	Tom Tucker
	<tom-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
Subject: Re: [PATCH v2 00/12] IB: Replace safe uses for ib_get_dma_mr with pd->local_dma_lkey
Date: Fri, 31 Jul 2015 16:32:52 -0700	[thread overview]
Message-ID: <55BC05A4.1020403@sandisk.com> (raw)
In-Reply-To: <20150731231430.GA1955-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]

On 07/31/2015 04:14 PM, Jason Gunthorpe wrote:
> Do you by chance have a straightforward recipe to setup SRP and SRPT
> on two Linux's for this simple purpose?

Some time ago I wrote a script that loads the upstream SRP target driver 
and creates two LUNs for local RAM disks (attached to this e-mail). The 
only disadvantage of that script is that it is based on the obsolete 
lio-utils package.

In case you would prefer the SCST SRP target driver, the following 
instructions should be sufficient to build, install, load and configure 
it on an RPM based system (please replace the GUID shown below by a GUID 
of a port of the HCA in your the target system):

svn co svn://svn.code.sf.net/p/scst/svn/trunk scst-trunk ||
   git clone https://github.com/bvanassche/scst.git scst-trunk
cd scst-trunk
make rpm
su
rpm -U {,scstadmin/}rpmbuilddir/RPMS/x86_64/*.rpm
cat <<EOF >/etc/scst.conf
HANDLER vdisk_blockio {
     DEVICE brd {
	filename /dev/ram0
     }
}
TARGET_DRIVER ib_srpt {
     TARGET fe80:0000:0000:0000:24be:05ff:ffa9:cbb1 {
         enabled 1
         LUN 0 brd
     }
}
EOF
modprobe brd
/etc/init.d/scst restart

Bart.

[-- Attachment #2: restart-lio-srpt --]
[-- Type: text/plain, Size: 3426 bytes --]

#!/bin/bash

filesize=$((16*1024*1024))
hcas="$(cat /sys/devices/*/*/*/infiniband/*/ports/*/gids/0 | sed 's/^\(....\):\(....\):\(....\):\(....\):\(....\):\(....\):\(....\):\(....\)$/0x0000\2\3\4\5\6\7\8 0x\5\6\7\8 0x\1\2\3\4\5\6\7\8/')"
# Output of cat /sys/devices/*/*/*/infiniband/*/ports/*/gids/0 on the remote
# systems
initiators="\
0x00000000000000000002c9030003cca7 \
0x00000000000000000002c9030003cca8 \
0x00000000000000000002c9030005f34f \
0x00000000000000000002c9030005f350 \
0x00000000000000000002c90300a34271 \
0x00000000000000000002c90300a34272 \
0x00000000000000000002c90300fab7f1 \
0x00000000000000000002c90300fab7f2"

if [ ! -e /sys/module/configfs ]; then
  modprobe configfs
fi
if ! mount | grep -qw configfs; then
  mount -t configfs none /sys/kernel/config
fi

if cd /sys/kernel/config/target >&/dev/null; then
  for hca in ${hcas}; do
    if [ -e srpt/$hca/$hca/enable ]; then
      echo 0 >srpt/$hca/$hca/enable
    fi
  done
fi
cd /

rm -f /sys/kernel/config/target/srpt/*/*/acls/*/*/* >&/dev/null
rmdir /sys/kernel/config/target/srpt/*/*/acls/*/* >&/dev/null
rmdir /sys/kernel/config/target/srpt/*/*/acls/* >&/dev/null
rm -f /sys/kernel/config/target/srpt/*/*/lun/*/* >&/dev/null
rmdir /sys/kernel/config/target/srpt/*/*/lun/* >&/dev/null
rmdir /sys/kernel/config/target/srpt/*/* >&/dev/null
rmdir /sys/kernel/config/target/srpt/* >&/dev/null
rmdir /sys/kernel/config/target/srpt >&/dev/null

if [ -e /sys/module/ib_srpt ]; then
  rmmod ib_srpt
fi

rmdir /sys/kernel/config/target/core/*/* >&/dev/null
rmdir /sys/kernel/config/target/core/* >&/dev/null

#find /sys/kernel/config/target

for m in ib_srpt target_core_pscsi target_core_iblock target_core_file target_core_stgt target_core_user target_core_mod
do
  if [ -e /sys/module/$m ]; then
    rmmod $m
  fi
done

if [ "$1" = "stop" ]; then
  exit 0
fi

modprobe target_core_mod

if [ -e /sys/kernel/debug/dynamic_debug/control ]; then
  #echo 'module target_core_mod +p' > /sys/kernel/debug/dynamic_debug/control
  :
fi

insmod /lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko srp_max_req_size=4200 || exit $?

if [ -e /sys/kernel/debug/dynamic_debug/control ]; then
  echo 'module ib_srpt +p' > /sys/kernel/debug/dynamic_debug/control
fi

modprobe target_core_file || exit $?
if [ ! -e /dev/ramdisk ]; then 
  dd if=/dev/zero of=/dev/ramdisk bs=${filesize} count=1
fi

if false && cd /sys/kernel/debug/tracing; then
  echo function >current_tracer
  { echo 'srpt_*'; echo 'transport_*'; } >set_ftrace_filter
  echo 1 >tracing_on
fi

vdev0="fileio_0/vdev0"
vdev1="fileio_1/vdev2"
vdev2="rd_dr_0/vdev1"
vdevs="$vdev0 $vdev1"
vdev_count=2
tcm_node --fileio $vdev0 /dev/ramdisk ${filesize}
tcm_node --fileio $vdev1 /dev/ramdisk 65536
if [ -e /sys/kernel/config/target/core/rd_dr_0 ]; then
  tcm_node --ramdisk $vdev2 2
  vdevs="$vdevs vdev2"
  vdev_count=3
fi
cd /sys/kernel/config/target || exit $?
mkdir srpt || exit $?
cd srpt || exit $?
for hca in ${hcas}; do
  mkdir $hca
  [ -e $hca ] || continue
  echo $hca
  mkdir $hca/$hca
  i=0
  for v in ${vdevs}; do
    mkdir $hca/$hca/lun/lun_$i
    ( cd $hca/$hca/lun/lun_$i && ln -s ../../../../../core/$v )
    i=$((i+1))
  done
  for ini in ${initiators}; do
  (
    cd $hca/$hca/acls
    mkdir ${ini}
    cd ${ini}
    for ((i = 0; i < $vdev_count; i++)) do
      ( mkdir lun_$i && cd lun_$i && ln -s ../../../lun/lun_$i )
    done
  )
  echo 1 >$hca/$hca/enable
  done
done

  parent reply	other threads:[~2015-07-31 23:32 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 23:22 [PATCH v2 00/12] IB: Replace safe uses for ib_get_dma_mr with pd->local_dma_lkey Jason Gunthorpe
     [not found] ` <1438298547-21404-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-07-30 23:22   ` [PATCH v2 01/12] IB/core: Guarantee that a local_dma_lkey is available Jason Gunthorpe
2015-08-02 13:09     ` Haggai Eran
2015-08-04  3:21       ` Jason Gunthorpe
2015-07-30 23:22   ` [PATCH v2 03/12] IB/ipoib: Remove ib_get_dma_mr calls Jason Gunthorpe
2015-07-30 23:22   ` [PATCH v2 08/12] IB/srp: Use pd->local_dma_lkey Jason Gunthorpe
2015-07-31 23:05     ` Bart Van Assche
2015-07-30 23:22   ` [PATCH v2 12/12] rds/ib: Remove ib_get_dma_mr calls Jason Gunthorpe
2015-08-14  2:47     ` santosh shilimkar
2015-07-30 23:22 ` [PATCH v2 02/12] IB/mad: " Jason Gunthorpe
2015-07-30 23:22 ` [PATCH v2 04/12] IB/mlx4: " Jason Gunthorpe
2015-07-30 23:22 ` [PATCH v2 05/12] IB/mlx5: " Jason Gunthorpe
2015-07-30 23:22 ` [PATCH v2 06/12] IB/iser: Use pd->local_dma_lkey Jason Gunthorpe
2015-07-30 23:22 ` [PATCH v2 07/12] iser-target: Remove ib_get_dma_mr calls Jason Gunthorpe
2015-07-30 23:22 ` [PATCH v2 09/12] IB/srp: Do not create an all physical insecure rkey by default Jason Gunthorpe
2015-08-03 15:39   ` Christoph Hellwig
2015-08-03 17:18   ` Bart Van Assche
2015-07-30 23:22 ` [PATCH v2 10/12] ib_srpt: Remove ib_get_dma_mr calls Jason Gunthorpe
2015-07-30 23:22 ` [PATCH v2 11/12] net/9p: " Jason Gunthorpe
2015-07-31  7:42 ` [PATCH v2 00/12] IB: Replace safe uses for ib_get_dma_mr with pd->local_dma_lkey Christoph Hellwig
2015-07-31 13:26 ` Steve Wise
2015-07-31 22:20 ` Bart Van Assche
     [not found]   ` <55BBF4B8.2050700-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-07-31 22:31     ` Jason Gunthorpe
     [not found]       ` <20150731223153.GA1518-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-07-31 23:04         ` Bart Van Assche
     [not found]           ` <55BBFF03.7000505-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-07-31 23:14             ` Jason Gunthorpe
     [not found]               ` <20150731231430.GA1955-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-07-31 23:32                 ` Bart Van Assche [this message]
2015-08-01 20:05                 ` Doug Ledford
     [not found]                   ` <55BD2689.3080602-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-08-11 20:50                     ` Bart Van Assche
     [not found]                       ` <55CA600B.1050706-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-08-14 13:36                         ` Doug Ledford
     [not found]                           ` <55CDEEFA.4010803-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-08-14 16:20                             ` Bart Van Assche
     [not found]                               ` <55CE1554.60001-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-08-15  2:08                                 ` Doug Ledford
2015-08-03 15:24   ` Christoph Hellwig
     [not found]     ` <20150803152420.GA24193-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2015-08-03 18:33       ` Bart Van Assche
     [not found]         ` <55BFB40F.8000500-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-08-04 18:09           ` Jason Gunthorpe
     [not found]             ` <20150804180933.GB5038-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-08-05  6:41               ` David Dillow
     [not found]                 ` <1438756876.5698.2.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2015-08-05 19:51                   ` Jason Gunthorpe
     [not found]                     ` <20150805195122.GA31595-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-08-05 21:45                       ` Bart Van Assche
     [not found]                         ` <55C2840C.5050301-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-08-05 22:41                           ` Bart Van Assche
     [not found]                             ` <55C2912A.50709-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-08-06  0:10                               ` Jason Gunthorpe
     [not found]                                 ` <20150806001006.GD2483-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-08-06  0:19                                   ` Bart Van Assche
     [not found]                                     ` <55C2A7FE.7020904-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-08-06  4:36                                       ` Jason Gunthorpe
     [not found]                                         ` <20150806043642.GA14153-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-08-06 15:09                                           ` Bart Van Assche
2015-08-11  0:05                                           ` [PATCH 0/9] IB/srp: Do not create an all physical insecure rkey by default Bart Van Assche
     [not found]                                             ` <55C93C61.9010508-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-08-11  0:06                                               ` [PATCH 1/8] IB/srp: Re-enable FMR for non-page aligned buffers Bart Van Assche
     [not found]                                                 ` <55C93C85.6090003-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-08-16 10:53                                                   ` Sagi Grimberg
     [not found]                                                     ` <55D06BB3.7070905-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-08-16 15:49                                                       ` Bart Van Assche
2015-08-11  0:06                                               ` [PATCH 2/8] IB/srp: Use multiple registrations for large memory regions Bart Van Assche
2015-08-11  0:07                                               ` [PATCH 3/8] IB/srp: Add memory descriptor array pointer range checking Bart Van Assche
     [not found]                                                 ` <55C93CBF.1060606-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-08-16 10:57                                                   ` Sagi Grimberg
     [not found]                                                     ` <55D06C9D.7030608-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-08-16 15:51                                                       ` Bart Van Assche
2015-08-11  0:07                                               ` [PATCH 4/8] IB/srp: Remove the memory registration backtracking code Bart Van Assche
2015-08-11  0:08                                               ` [PATCH 5/8] IB/srp: Remove use_mr argument from srp_map_sg_entry() Bart Van Assche
2015-08-11  0:08                                               ` [PATCH 6/8] IB/srp: Introduce srp_device.use_fmr Bart Van Assche
     [not found]                                                 ` <55C93D0C.7060000-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-08-16 11:03                                                   ` Sagi Grimberg
     [not found]                                                     ` <55D06E05.5060209-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-08-16 15:57                                                       ` Bart Van Assche
2015-08-11  0:09                                               ` [PATCH 7/8] IB/srp: Register the indirect data buffer descriptor Bart Van Assche
     [not found]                                                 ` <55C93D21.1090102-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-08-16 11:09                                                   ` Sagi Grimberg
     [not found]                                                     ` <55D06F56.4060005-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-08-16 16:56                                                       ` Bart Van Assche
2015-08-11  0:09                                               ` [PATCH 8/8] IB/srp: Create an insecure all physical rkey only if needed Bart Van Assche
2015-08-11  5:40                                               ` [PATCH 0/9] IB/srp: Do not create an all physical insecure rkey by default Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55BC05A4.1020403@sandisk.com \
    --to=bart.vanassche-xdaiopvojttbdgjk7y7tuq@public.gmane.org \
    --cc=amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=chien.yen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=dominique.martinet-KCE40YydGKI@public.gmane.org \
    --cc=eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=ericvh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=idos-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lucho-OnYtXJJ0/fesTnJN9+BGXg@public.gmane.org \
    --cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=rminnich-4OHPYypu0djtX7QSmKvirg@public.gmane.org \
    --cc=roid-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=simon.derr-6ktuUTfB/bM@public.gmane.org \
    --cc=tom-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.