1219820SjeffIntroduction
2219820Sjeff============
3219820Sjeff
4219820Sjefflibmthca is a userspace driver for Mellanox InfiniBand HCAs.  It works
5219820Sjeffas a plug-in module for libibverbs that allows programs to use
6219820SjeffMellanox hardware directly from userspace.  See the libibverbs package
7219820Sjefffor more information.
8219820Sjeff
9219820SjeffUsing libmthca
10219820Sjeff==============
11219820Sjeff
12219820Sjefflibmthca will be loaded and used automatically by programs linked with
13219820Sjefflibibverbs.  The ib_mthca kernel module must be loaded for HCA devices
14219820Sjeffto be detected and used.
15219820Sjeff
16219820SjeffSupported Hardware
17219820Sjeff==================
18219820Sjeff
19219820Sjefflibmthca currently supports HCAs based on the following Mellanox chips:
20219820Sjeff
21219820Sjeff    MT23108 InfiniHost (PCI-X)
22219820Sjeff    MT25208 InfiniHost III Ex (PCI Express)
23219820Sjeff    MT25204 InfiniHost III Lx (PCI Express)
24219820Sjeff
25219820SjeffBoth non-DDR and DDR HCAs are supported, and the MT25208 is supported
26219820Sjeffwith both MT23108-compatible and native MemFree firmware.
27219820Sjeff
28219820SjeffValgrind Support
29219820Sjeff================
30219820Sjeff
31219820SjeffWhen running applications that use libibverbs under the Valgrind
32219820Sjeffmemory-checking debugger, Valgrind will falsely report "read from
33219820Sjeffuninitialized" for memory that was initialized by the kernel drivers
34219820Sjeffor HCA hardware.  Specifically, Valgrind cannot see when kernel
35219820Sjeffdrivers or HCA hardware write to userspace memory, so when the process
36219820Sjeffreads from that memory, Valgrind incorrectly assumes that the memory
37219820Sjeffcontents are uninitialized, and therefore raises a warning.
38219820Sjeff
39219820Sjefflibmthca can be built with specific support for the Valgrind
40219820Sjeffmemory-checking debugger by specifying the --with-valgrind command
41219820Sjeffline argument to configure.  This flag enables code in libibverbs to
42219820Sjefftell Valgrind "this memory may look uninitialized, but it's really
43219820SjeffOK," which therefore suppresses the incorrect "read from
44219820Sjeffuninitialized" warnings.  This code adds trivial overhead to the
45219820Sjeffcritical performance path, so it is disabled by default.  The intent
46219820Sjeffis that production users can use a "normal" build of libmthca and
47219820Sjeffdevelopers can use the "valgrind debug" build by simply switching
48219820Sjefftheir OPENIB_DRIVER_PATH environment variables.
49219820Sjeff
50219820SjeffLibmthca needs some header files from Valgrind in order to compile
51219820Sjeffthis support; it is important to use the header files from the same
52219820Sjeffversion of Valgrind that will be used at run time.  You may need to
53219820Sjeffspecify the directory where Valgrind's header files are installed as
54219820Sjeffan argument to --with-valgrind.  For example
55219820Sjeff
56219820Sjeff	./configure --with-valgrind=/opt/valgrind
57219820Sjeff
58219820Sjeffwill make the libmthca build look for valgrind headers in
59219820Sjeff/opt/valgrind/include
60