]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sdp: fix keepalive functionality
authorshamir rabinovitch <shamir.rabinovitch@oracle.com>
Mon, 12 May 2014 15:34:02 +0000 (08:34 -0700)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:45:41 +0000 (05:45 -0700)
commit3bc44760391e34b22df736a725176cc3bb280ada
treedfe0e4808c18e287ec2ad6a4a35c0b4a50c0ee16
parent2f21f444ec59603e3ac905baf302cb8a33267402
sdp: fix keepalive functionality

sdp keepalive functionality differ a bit from tcp socket functionality.
in sdp only accepted or connected socket can trigger this functionality
as the keepalive is implemented as rdma write with zero length and this
require ib connection. due to this sdp behaviour you cannot set keepalive
on listening server socket or on non connected client socket. apps can
use sdp in 2 ways. binary apps that use tcp sockets can use the libsdp
to direct all the socket calls to sdp and new apps can open and use sdp
sockets directly w/o the need for libsdp. when using sdp socket directly
please follow the below rules:

- define: AF_INET_SDP = SOL_SDP = 27
- create the socket as follow:
socket(AF_INET_SDP, SOCK_STREAM, 0)
- get the sdp socket keepalive as follow:
getsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &optval, &optlen)
- set the sdp socket keepalive as follow:
setsockopt(fd, SOL_SDP, SO_KEEPALIVE, &optval, optlen)

when you load the sdp module;
- set the keepalive time. this is the max period in sec of no data before
sdp start to send the probes. you should take to account that more
then one probe is needed till sdp detect that the remote hca is gone.
echo <time sec> > /sys/module/ib_sdp/parameters/sdp_keepalive_time
- zero the probes counter. this counter is incremented any time sdp send probe.
probes are sent only if there is no tx/rx on this queue pair for the
keepalive time period.
echo 0 > /sys/module/ib_sdp/parameters/sdp_keepalive_probes_sent

on server socket:
- set keepalive only on accepted socket

on client socket:
- set keepalive only on socket after connect

Orabug: 18728784

Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
Signed-off-by: Vadim Makhervaks <vadim.makhervaks@oracle.com>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
drivers/infiniband/ulp/sdp/sdp_main.c
drivers/infiniband/ulp/sdp/sdp_tx.c