1219820SjeffIntroduction
2219820Sjeff============
3219820Sjeff
4219820Sjefflibmlx4 is a userspace driver for Mellanox ConnectX InfiniBand HCAs.
5219820SjeffIt is 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 libmlx4
10219820Sjeff==============
11219820Sjeff
12219820Sjefflibmlx4 will be loaded and used automatically by programs linked with
13219820Sjefflibibverbs.  The mlx4_ib kernel module must be loaded for HCA devices
14219820Sjeffto be detected and used.
15219820Sjeff
16219820SjeffSupported Hardware
17219820Sjeff==================
18219820Sjeff
19219820Sjefflibmlx4 currently supports HCAs based on the following Mellanox chip:
20219820Sjeff
21219820Sjeff    MT25408 ConnectX (PCI Express)
22219820Sjeff
23219820SjeffThese HCAs use the mlx4_ib kernel driver.  Support for other Mellanox
24219820SjeffHCAs, which use the ib_mthca kernel driver, is provided by the
25219820Sjefflibmthca userspace driver.
26219820Sjeff
27219820SjeffValgrind Support
28219820Sjeff================
29219820Sjeff
30219820SjeffWhen running applications that use libibverbs under the Valgrind
31219820Sjeffmemory-checking debugger, Valgrind will falsely report "read from
32219820Sjeffuninitialized" for memory that was initialized by the kernel drivers
33219820Sjeffor HCA hardware.  Specifically, Valgrind cannot see when kernel
34219820Sjeffdrivers or HCA hardware write to userspace memory, so when the process
35219820Sjeffreads from that memory, Valgrind incorrectly assumes that the memory
36219820Sjeffcontents are uninitialized, and therefore raises a warning.
37219820Sjeff
38219820Sjefflibmlx4 can be built with specific support for the Valgrind
39219820Sjeffmemory-checking debugger by specifying the --with-valgrind command
40219820Sjeffline argument to configure.  This flag enables code in libibverbs to
41219820Sjefftell Valgrind "this memory may look uninitialized, but it's really
42219820SjeffOK," which therefore suppresses the incorrect "read from
43219820Sjeffuninitialized" warnings.  This code adds trivial overhead to the
44219820Sjeffcritical performance path, so it is disabled by default.  The intent
45219820Sjeffis that production users can use a "normal" build of libmlx4 and
46219820Sjeffdevelopers can use the "valgrind debug" build by simply switching
47219820Sjefftheir OPENIB_DRIVER_PATH environment variables.
48219820Sjeff
49219820SjeffLibmlx4 needs some header files from Valgrind in order to compile this
50219820Sjeffsupport; it is important to use the header files from the same version
51219820Sjeffof Valgrind that will be used at run time.  You may need to specify
52219820Sjeffthe directory where Valgrind's header files are installed as an
53219820Sjeffargument to --with-valgrind.  For example
54219820Sjeff
55219820Sjeff	./configure --with-valgrind=/opt/valgrind
56219820Sjeff
57219820Sjeffwill make the libmlx4 build look for valgrind headers in
58219820Sjeff/opt/valgrind/include
59