Cisco Systems GEM318P Manual De Usuario

Descargar
Página de 74
5-2
Cisco SFS InfiniBand Host Drivers User Guide for Linux
OL-12309-01
Chapter 5      Sockets Direct Protocol
Converting Sockets-Based Application
Converting Sockets-Based Application
This section describes how to convert sockets-based applications. You can convert your sockets-based 
applications to use SDP instead of TCP by using one of two conversion types. This section includes the 
following topics:
Explicit/Source Code Conversion Type
The explicit or source code conversion type method converts sockets to use SDP based on application 
source code. This method is useful when you want full control from your application when using SDP. 
To use this method, change your source code to use AF_INET_SDP instead of AF_INET when calling 
the socket() system call.
AF_INET _SDP is defined as 26. Add the following line of code to the beginning of your program:
#define AF_INET_SDP 26
Automatic Conversion Type 
This section describes automatic conversion type. Use a text editor to open the libsdp configuration file 
(located in /usr/local/topspin/etc/libsdp.conf). This file defines when to automatically use SDP instead 
of TCP. You may edit this file to specify connection overrides. Use the environment variable 
LIBSDP_CONFIG_FILE to specify an alternate configuration file.
The automatic conversion type method converts socket streams based upon a destination port, listening 
port, or program name. 
Load the installed libsdp.so library using either of these two methods:
Set the LD_PRELOAD environment variable to libsdp.so before running the executable.
Add the full path of the library into /etc/ld.so.preload. This action causes the library to preload for 
every executable that is linked with libc. 
This configuration file supports two main types of statements:
log 
The log keyword sets logging-related configurations. The log settings take immediate effect, so they 
are defined at the beginning of the file.
match 
The match keyword enables the user to specify when libsdp replaces AF_INET/SOCK_STREAM 
sockets with AF_INET_SDP/SOCK_STREAM sockets.