Infiniband SRP and fast small IOPS

A couple of months ago I hit a problem getting Infiniband SRP connectivity functional on SLES 11 SP1 with the XEN kernel running. I first struggled to find the documentation, to get the SRP running on the non-standard Kernel. Then when it was running I struggled to get the respectable levels of IOPS performance from a single Violin Memory Array LUN.

Once you have IB connectivity to the storage working this gives you the ability to combine a resilient high bandwidth, low latency, network and storage connections on to a single card or pair of cards.

The interesting bit was the final step to get good performance above of 100k IOPS from an individual LUN. To do this I had to dedicate cores to the Hypervisor (Dom0) and also lock the affinity of those cores to a single CPU.

Different variations of the core count and which cores from which socket to pin have since been seen to provide benefits to other versions of Xen on linux distributions and different hardware platforms. I should note this is not an optimisation setting specific to IB SRP connectivity, we have seen a similar benefit when using FC connectivity

Of course depending on how you utilise the Guest VMs may determine if the extra performance from dedicating cores to the Hypervisor, is worth potentially reducing the cores available to Guests.

More details are below, in case any one is working on a similar setup, or is struggling to sleep 🙂

Steps required installing and configuring IB SRP connectivity on SLES 11 SP1

Step 1, Install the OS
Install SLES with xen host option ticked or add xen from yast option afterwards. (problems have been seen on the SM hardware nics installing the xen kernel during install.
Change /boot/grub/menu.lst file to point at the xen kernel by default and reboot.

Step 2,
Install pre req packages required to be able to compile IB drivers for the xen kernel.
The list is in the readme file on the driver package from Mellanox.

On SLES this is easiest from yast

From read me
OS Distribution Required Packages
————— ———————————-
General:
o Common to all gcc, glib, glib-devel, glibc, glibc-devel,
glibc-devel-32bit (to build 32-bit libraries on x86_64
and ppc64), zlib-devel, libstdc++-devel
o RedHat, Fedora kernel-devel, rpm-build, redhat-rpm-config
o SLES kernel-source, kernel-syms, rpm

Note: To build 32-bit libraries on x86_64 and ppc64 platforms, the 32-bit
glibc-devel should be installed.

Step3 Re-compile the Mellanox driver for SLES to include SRP support.
Copy the Mellanox driver bundle to the server and mount the iso

mount -o ro,loop MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso /mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso

Copy the fies from the iso to a temporary folder and run

server1:/tmp/tom # ./mlnx_add_kernel_support.sh -i /root/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso
Note: This program will create MLNX_OFED_LINUX ISO for SLES11sp1 under /tmp directory.
All Mellanox, OEM, OFED, or Distribution IB packages will be removed.
Do you want to continue?[y/N]:y
See log file /tmp/mlnx_ofed_iso.6694.log

Building OFED RPMs. Please wait…
Removing OFED RPMs…
Running mkisofs…
Created /tmp/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso

server1:/tmp/tom # umount /mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso/

server1:/tmp/tom # mount -o ro,loop /tmp/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso /mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso

Install drivers

server1:/mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso # ./mlnxofedinstall
This program will install the MLNX_OFED_LINUX package on your machine.
Note that all other Mellanox, OEM, OFED, or Distribution IB packages will be removed.
Do you want to continue?[y/N]:y

Starting MLNX_OFED_LINUX-1.5.3-3.1.0 installation …

Installing kernel-ib RPM
Preparing… ##################################################
kernel-ib ##################################################
Installing kernel-ib-devel RPM
Preparing… ##################################################
kernel-ib-devel ##################################################
Installing kernel-mft RPM
Preparing… ##################################################
kernel-mft ##################################################
Installing knem RPM
Preparing… ##################################################
knem ##################################################
Installing mpi-selector RPM
Preparing… ##################################################
mpi-selector ##################################################
Installing user level RPMs:
Preparing… ##################################################
ofed-scripts ##################################################
Preparing… ##################################################
libibverbs ##################################################
Preparing… ##################################################
libibverbs ##################################################
Preparing… ##################################################
libibverbs-devel ##################################################
Preparing… ##################################################
libibverbs-devel ##################################################
Preparing… ##################################################
libibverbs-devel-static ##################################################
Preparing… ##################################################
libibverbs-devel-static ##################################################
Preparing… ##################################################
libibverbs-utils ##################################################
Preparing… ##################################################
libmthca ##################################################
Preparing… ##################################################
libmthca ##################################################
Preparing… ##################################################
libmthca-devel-static ##################################################
Preparing… ##################################################
libmthca-devel-static ##################################################
Preparing… ##################################################
libmlx4 ##################################################
Preparing… ##################################################
libmlx4 ##################################################
Preparing… ##################################################
libmverbs ##################################################
Preparing… ##################################################
libmverbs ##################################################
Preparing… ##################################################
libmlx4-devel ##################################################
Preparing… ##################################################
libmlx4-devel ##################################################
Preparing… ##################################################
libmverbs-devel ##################################################
Preparing… ##################################################
libmverbs-devel ##################################################
Preparing… ##################################################
libmqe ##################################################
Preparing… ##################################################
libmqe ##################################################
Preparing… ##################################################
libmqe-devel ##################################################
Preparing… ##################################################
libmqe-devel ##################################################
Preparing… ##################################################
libcxgb3 ##################################################
Preparing… ##################################################
libcxgb3 ##################################################
Preparing… ##################################################
libcxgb3-devel ##################################################
Preparing… ##################################################
libcxgb3-devel ##################################################
Preparing… ##################################################
libnes ##################################################
Preparing… ##################################################
libnes ##################################################
Preparing… ##################################################
libnes-devel-static ##################################################
Preparing… ##################################################
libnes-devel-static ##################################################
Preparing… ##################################################
libipathverbs ##################################################
Preparing… ##################################################
libipathverbs ##################################################
Preparing… ##################################################
libipathverbs-devel ##################################################
Preparing… ##################################################
libipathverbs-devel ##################################################
Preparing… ##################################################
libibcm ##################################################
Preparing… ##################################################
libibcm ##################################################
Preparing… ##################################################
libibcm-devel ##################################################
Preparing… ##################################################
libibcm-devel ##################################################
Preparing… ##################################################
libibumad ##################################################
Preparing… ##################################################
libibumad ##################################################
Preparing… ##################################################
libibumad-devel ##################################################
Preparing… ##################################################
libibumad-devel ##################################################
Preparing… ##################################################
libibumad-static ##################################################
Preparing… ##################################################
libibumad-static ##################################################
Preparing… ##################################################
libibmad ##################################################
Preparing… ##################################################
libibmad ##################################################
Preparing… ##################################################
libibmad-devel ##################################################
Preparing… ##################################################
libibmad-devel ##################################################
Preparing… ##################################################
libibmad-static ##################################################
Preparing… ##################################################
libibmad-static ##################################################
Preparing… ##################################################
ibsim ##################################################
Preparing… ##################################################
ibacm ##################################################
Preparing… ##################################################
librdmacm ##################################################
Preparing… ##################################################
librdmacm ##################################################
Preparing… ##################################################
librdmacm-utils ##################################################
Preparing… ##################################################
librdmacm-devel ##################################################
Preparing… ##################################################
librdmacm-devel ##################################################
Preparing… ##################################################
libsdp ##################################################
Preparing… ##################################################
libsdp ##################################################
Preparing… ##################################################
libsdp-devel ##################################################
Preparing… ##################################################
libsdp-devel ##################################################
Preparing… ##################################################
opensm-libs ##################################################
Preparing… ##################################################
opensm-libs ##################################################
Preparing… ##################################################
opensm ##################################################
opensmd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
Preparing… ##################################################
opensm-devel ##################################################
Preparing… ##################################################
opensm-devel ##################################################
Preparing… ##################################################
opensm-static ##################################################
Preparing… ##################################################
opensm-static ##################################################
Preparing… ##################################################
compat-dapl ##################################################
Preparing… ##################################################
compat-dapl ##################################################
Preparing… ##################################################
compat-dapl-devel ##################################################
Preparing… ##################################################
compat-dapl-devel ##################################################
Preparing… ##################################################
dapl ##################################################
Preparing… ##################################################
dapl ##################################################
Preparing… ##################################################
dapl-devel ##################################################
Preparing… ##################################################
dapl-devel ##################################################
Preparing… ##################################################
dapl-devel-static ##################################################
Preparing… ##################################################
dapl-devel-static ##################################################
Preparing… ##################################################
dapl-utils ##################################################
Preparing… ##################################################
perftest ##################################################
Preparing… ##################################################
mstflint ##################################################
Preparing… ##################################################
mft ##################################################
Preparing… ##################################################
sdpnetstat ##################################################
Preparing… ##################################################
srptools ##################################################
Preparing… ##################################################
rds-tools ##################################################
Preparing… ##################################################
rds-devel ##################################################
Preparing… ##################################################
ibutils2 ##################################################
Preparing… ##################################################
ibutils ##################################################
Preparing… ##################################################
cc_mgr ##################################################
Preparing… ##################################################
dump_pr ##################################################
Preparing… ##################################################
ar_mgr ##################################################
Preparing… ##################################################
ibdump ##################################################
Preparing… ##################################################
infiniband-diags ##################################################
Preparing… ##################################################
qperf ##################################################
Preparing… ##################################################
fca ##################################################
INFO: updating …

IMPORTANT NOTE:
===============

– The FCA Manager and FCA MPI Runtime library are installed in /opt/mellanox/fca directory.
– The FCA Manager will not be started automatically.
– To start FCA Manager now, type:
# /etc/init.d/fca_managerd start

– There should be single process of FCA Manager running per fabric.

– To start FCA Manager automatically after boot, type:
# /etc/init.d/fca_managerd install_service

– Check /opt/mellanox/fca/share/doc/fca/README.txt for quick start instructions.

Preparing… ##################################################
mxm ##################################################
Preparing… ##################################################
infinipath-psm ##################################################
Preparing… ##################################################
infinipath-psm-devel ##################################################
Preparing… ##################################################
mvapich_gcc ##################################################
Failed to install RPMs

Step 4 ConfigureIB services

server1:/mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso # chkconfig –list |grep ib
libvirtd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
openibd 0:off 1:off 2:on 3:on 4:off 5:on 6:off
server1:/mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso # chkconfig openibd 235
server1:/mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso # chkconfig –list |grep opens
opensmd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
server1:/mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso # chkconfig opensmd 235
insserv: warning: script ‘mst’ missing LSB tags and overrides
insserv: Default-Start undefined, assuming default start runlevel(s) for script `mst’
insserv: warning: script ‘mst’ missing LSB tags and overrides
insserv: Default-Start undefined, assuming default start runlevel(s) for script `mst’
server1:/mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso #

server1:/mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso # chkconfig –list |grep multi
multipathd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
server1:/mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso # chkconfig multipathd on
insserv: warning: script ‘mst’ missing LSB tags and overrides
insserv: Default-Start undefined, assuming default start runlevel(s) for script `mst’
server1:/mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso # chkconfig –list |grep multi
multipathd 0:off 1:off 2:off 3:on 4:off 5:on 6:off

Edit the openIB.conf file

server1:/mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso # vi /etc/infiniband/openib.conf
server1:/mnt/MLNX_OFED_LINUX-1.5.3-3.1.0-SLES11sp1-x86_64.iso # cat /etc/infiniband/openib.conf |grep -v ^\#
ONBOOT=yes
NODE_DESC=$(hostname -s)
NODE_DESC_TIME_BEFORE_UPDATE=10
UCM_LOAD=yes
RDMA_CM_LOAD=yes
RDMA_UCM_LOAD=yes
RENICE_IB_MAD=no
RUN_SYSCTL=yes
MTHCA_LOAD=yes
QIB_LOAD=yes
MLX4_LOAD=yes
MLX4_EN_LOAD=yes
MLX4_VNIC_LOAD=no
CXGB3_LOAD=yes
NES_LOAD=yes
IPOIB_LOAD=yes
SET_IPOIB_CM=yes
SDP_LOAD=no
SRP_LOAD=yes
ISER_LOAD=no
RDS_LOAD=no
SRPHA_ENABLE=no
SRP_DAEMON_ENABLE=yes

Put the Violin recommended multipath.conf and vdbench files in place and reboot

Step 6

Export some luns from the Violin master gateway VIP to an igroup containing the guid for the Server in question.

memgate-220953 [v6232: master] (config) # show igroup
Initiator group: IB_SLES #Initiators: 4
guid.0000:c903:0057:8290
guid.0000:c903:0057:8293
guid.0002:c903:0057:8291
guid.0002:c903:0057:8292
memgate-220953 [v6232: master] (config) # show exports
Container LUN Target Initiator LUNID Status
——————————————————————————–
41216F00254 Test_3 hca-a all 3 HA
41216F00254 Test_3 hca-b all 3 HA
41216F00254 Test_4 hca-a all 4 HA
41216F00254 Test_4 hca-b all 4 HA
41216F00254 test hca-a all 1 HA
41216F00254 test hca-b all 1 HA
41216F00254 test_2 hca-a all 2 HA
41216F00254 test_2 hca-b all 2 HA
41216F00254 webfarm1 hca-a all 5 HA
41216F00254 webfarm1 hca-b all 5 HA
41216F00254 webfarm2 hca-a all 6 HA
41216F00254 webfarm2 hca-b all 6 HA
41216F00254 webfarm3 hca-a all 7 HA
41216F00254 webfarm3 hca-b all 7 HA
41216F00254 webfarm4 hca-a all 8 HA
41216F00254 webfarm4 hca-b all 8 HA

Step 7 Check for lun visibility on the server

server1:~ # uname -a
Linux server1 2.6.32.12-0.7-xen #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux

server1:~ # multipath -ll
mpathe (SVIOLIN_SAN_ARRAY_DF2B3E01F9F71EB6) dm-4 VIOLIN,SAN ARRAY
size=123G features=’0′ hwhandler=’0′ wp=rw
`-+- policy=’round-robin 0′ prio=1 status=active
|- 13:0:0:7 sdi 8:128 active ready running
|- 14:0:0:7 sdq 65:0 active ready running
|- 15:0:0:7 sdy 65:128 active ready running
`- 16:0:0:7 sdag 66:0 active ready running
.
.
.

Step 8 Check performance with vdbench

This may require installing the JRE packages if they are not already

server1:~ # more vdbench_config
sd=sd0,lun=/dev/dm-39,openflags=o_direct

rd=4K_Random_Readbd,wd=4K_Random_Read*,interval=5,iorate=max,elapsed=30,forthreads=(14),
rd=4K_Random_Readce,wd=4K_Random_Read*,interval=5,iorate=max,elapsed=30,forthreads=(16),

server1:~ # ./vdbench -f vdbench_config

Vdbench distribution: vdbench503rc11
For documentation, see ‘vdbench.pdf’.

20:03:24.601 *
20:03:24.601 * This beta version ‘vdbench503rc11’ was built on Fri April 08 9:48:23 MDT 2011.
20:03:24.601 * which is more than 90 days ago.
20:03:24.602 * It is recommended that you look for a newer beta or possibly
20:03:24.602 * a newer GA version.
20:03:24.602 * Of course, it is preferred you download a newer beta version
20:03:24.602 * if available to help test the latest code.
20:03:24.602 *
20:03:24.604 input argument scanned: ‘-fvdbench_config’
20:03:24.732 Starting slave: /root/vdbench SlaveJvm -m localhost -n localhost-10-130120-20.03.24.556 -l localhost-0 -p 5570
20:03:25.823 All slaves are now connected
20:04:22.003 Starting RD=4K_Random_Readbd; I/O rate: Uncontrolled MAX; elapsed=10; For loops: threads=14.0

Jan 20, 2013 interval i/o MB/sec bytes read resp read write resp resp queue cpu% cpu%
rate 1024**2 i/o pct time resp resp max stddev depth sys+u sys
20:04:24.013 1 56772.50 221.77 4096 100.00 0.242 0.242 0.000 5.003 0.075 13.7 4.6 3.7
20:04:26.050 2 59928.50 234.10 4096 100.00 0.235 0.235 0.000 3.139 0.044 14.1 5.0 3.8
20:04:28.052 3 57940.50 226.33 4096 100.00 0.234 0.234 0.000 1.750 0.040 13.5 4.5 3.8
20:04:30.052 4 59416.00 232.09 4096 100.00 0.233 0.233 0.000 5.271 0.065 13.8 3.9 3.5
20:04:32.051 5 59473.00 232.32 4096 100.00 0.232 0.232 0.000 6.729 0.054 13.8 4.2 3.6
20:04:32.054 avg_2-5 59189.50 231.21 4096 100.00 0.233 0.233 0.000 6.729 0.052 13.8 4.4 3.7
20:04:33.003 Starting RD=4K_Random_Readce; I/O rate: Uncontrolled MAX; elapsed=10; For loops: threads=16.0

Jan 20, 2013 interval i/o MB/sec bytes read resp read write resp resp queue cpu% cpu%
rate 1024**2 i/o pct time resp resp max stddev depth sys+u sys
20:04:35.011 1 64992.00 253.88 4096 100.00 0.241 0.241 0.000 6.340 0.064 15.7 4.1 3.5
20:04:37.052 2 63007.00 246.12 4096 100.00 0.251 0.251 0.000 13.526 0.110 15.8 5.4 4.9
20:04:39.051 3 64862.00 253.37 4096 100.00 0.242 0.242 0.000 5.351 0.049 15.7 5.2 4.6
20:04:41.048 4 63141.50 246.65 4096 100.00 0.248 0.248 0.000 18.297 0.101 15.7 5.8 4.9
20:04:43.053 5 65678.00 256.55 4096 100.00 0.240 0.240 0.000 3.297 0.053 15.8 6.1 5.5
20:04:43.055 avg_2-5 64172.12 250.67 4096 100.00 0.245 0.245 0.000 18.297 0.083 15.7 5.6 5.0
20:04:44.003 Starting RD=4K_Random_Readd; I/O rate: Uncontrolled MAX; elapsed=10; For loops: threads=32.0

The above rates of IOPS are very low even for the single LUN on the Slowest of violins arrays that was being tested.

After some research it was found that giving Dom-0 the Hypervisor access to all 8 cores on one CPU socket, and pin’ing the hypervisor to those cores we were able to demonstrate respectable performance.

Prior to the change

21:35:02.003 Starting RD=4K_Random_Readd; I/O rate: Uncontrolled MAX; elapsed=10; For loops: threads=32.0

Jan 20, 2013 interval i/o MB/sec bytes read resp read write resp resp queue cpu% cpu%
rate 1024**2 i/o pct time resp resp max stddev depth sys+u sys
21:35:04.014 1 104751.00 409.18 4096 100.00 0.294 0.294 0.000 5.100 0.098 30.8 9.8 8.4
21:35:06.054 2 96334.50 376.31 4096 100.00 0.324 0.324 0.000 26.977 0.308 31.2 13.7 12.3
21:35:08.054 3 57867.00 226.04 4096 100.00 0.539 0.539 0.000 42.014 0.618 31.2 18.0 16.6
21:35:10.056 4 32946.50 128.70 4096 100.00 0.961 0.961 0.000 40.408 0.698 31.7 17.6 16.5
21:35:12.055 5 30703.00 119.93 4096 100.00 1.034 1.034 0.000 25.417 0.460 31.7 17.4 17.1
21:35:12.059 avg_2-5 54462.75 212.75 4096 100.00 0.577 0.577 0.000 42.014 0.572 31.4 16.7 15.7

After the change
xm vcpu-set Domain-0 8
xm vcpu-pin Domain-0 all all

21:45:33.003 Starting RD=4K_Random_Readd; I/O rate: Uncontrolled MAX; elapsed=10; For loops: threads=32.0

Jan 20, 2013 interval i/o MB/sec bytes read resp read write resp resp queue cpu% cpu%
rate 1024**2 i/o pct time resp resp max stddev depth sys+u sys
21:45:35.015 1 75897.50 296.47 4096 100.00 0.404 0.404 0.000 80.293 0.475 30.7 17.0 14.2
21:45:37.054 2 101608.50 396.91 4096 100.00 0.305 0.305 0.000 5.100 0.126 31.0 29.0 25.8
21:45:39.055 3 105596.00 412.48 4096 100.00 0.288 0.288 0.000 10.910 0.104 30.4 29.8 26.0
21:45:41.050 4 105490.00 412.07 4096 100.00 0.289 0.289 0.000 16.003 0.112 30.5 30.4 25.7
21:45:43.050 5 107178.50 418.67 4096 100.00 0.288 0.288 0.000 7.813 0.108 30.8 32.0 25.9
21:45:43.057 avg_2-5 104968.25 410.03 4096 100.00 0.292 0.292 0.000 16.003 0.113 30.7 30.3 25.9
21:45:44.003 Starting RD=4K_Random_Reade; I/O rate: Uncontrolled MAX; elapsed=10; For loops: threads=64.0