From: shamir rabinovitch Date: Mon, 12 May 2014 15:34:02 +0000 (-0700) Subject: sdp: fix keepalive functionality X-Git-Tag: v4.1.12-92~264^2~3^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3bc44760391e34b22df736a725176cc3bb280ada;p=users%2Fjedix%2Flinux-maple.git 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