Sean Hefty [Fri, 29 May 2015 18:24:26 +0000 (11:24 -0700)]
rsockets: Delay initializing buffers until the inline size is known
The qib HCA ignores the requested max_inline_size on input and
instead returns the supported value on output. As a result,
the default inline size requested by rsockets is ignored, with 0
being returned. The code catches this after it creates the QP, but
has already initialized its data buffers prior to creating the QP.
The result is that the inline size used in rs_init_bufs() is larger
than that supported by the qib device. This causes a failure when
attempting to update available receive buffer space. The registered
data buffer for the credit message is smaller than what is needed.
Work-around this issue by delaying the initialization of the data
buffers until after the QP has been created and the real size of
the inline data is known.
Sean Hefty [Fri, 29 May 2015 18:24:26 +0000 (11:24 -0700)]
rsockets: Delay initializing buffers until the inline size is known
The qib HCA ignores the requested max_inline_size on input and
instead returns the supported value on output. As a result,
the default inline size requested by rsockets is ignored, with 0
being returned. The code catches this after it creates the QP, but
has already initialized its data buffers prior to creating the QP.
The result is that the inline size used in rs_init_bufs() is larger
than that supported by the qib device. This causes a failure when
attempting to update available receive buffer space. The registered
data buffer for the credit message is smaller than what is needed.
Work-around this issue by delaying the initialization of the data
buffers until after the QP has been created and the real size of
the inline data is known.
Sean Hefty [Fri, 29 May 2015 18:24:26 +0000 (11:24 -0700)]
rsockets: Delay initializing buffers until the inline size is known
The qib HCA ignores the requested max_inline_size on input and
instead returns the supported value on output. As a result,
the default inline size requested by rsockets is ignored, with 0
being returned. The code catches this after it creates the QP, but
has already initialized its data buffers prior to creating the QP.
The result is that the inline size used in rs_init_bufs() is larger
than that supported by the qib device. This causes a failure when
attempting to update available receive buffer space. The registered
data buffer for the credit message is smaller than what is needed.
Work-around this issue by delaying the initialization of the data
buffers until after the QP has been created and the real size of
the inline data is known.
Sean Hefty [Tue, 28 Apr 2015 21:31:15 +0000 (14:31 -0700)]
Remove prints to stderr
The library should just fail operations with ENODEV, rather than
printing to stderr. Printing can result in applications failing,
or displaying incorrect error messages when no verb devices are
actually present.
Sean Hefty [Tue, 28 Apr 2015 21:31:15 +0000 (14:31 -0700)]
Remove prints to stderr
The library should just fail operations with ENODEV, rather than
printing to stderr. Printing can result in applications failing,
or displaying incorrect error messages when no verb devices are
actually present.
Sean Hefty [Tue, 28 Apr 2015 21:31:15 +0000 (14:31 -0700)]
Remove prints to stderr
The library should just fail operations with ENODEV, rather than
printing to stderr. Printing can result in applications failing,
or displaying incorrect error messages when no verb devices are
actually present.
Ilya Nelkenbaum [Thu, 26 Mar 2015 19:41:11 +0000 (12:41 -0700)]
cma: Workaround for rdma_ucm kernel bug
For certain new kernels, IB_QP_SMAC bit is erroneously
set in QP attribute mask. This workaround turns
off that bit. It allows SSA connections (AF_IB)
to work. Without this workaround, there are issues
on the client side.
Kernel patch which caused issue is commit dd5f03b
IB/core: Ethernet L2 attributes in verbs/cm structures
IB/core: When marshaling ucma path from user-space, clear unused fields
When marshaling a user path to the kernel struct ib_sa_path, we need
to zero smac and dmac and set the vlan id to the "no vlan" value.
This is to ensure that Ethernet attributes are not used with
InfiniBand QPs.
Fixes: dd5f03beb4f7 ("IB/core: Ethernet L2 attributes in verbs/cm structures") Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
The fix was pushed to stable 3.14, 3.18 and 3.19 versions.
Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com> Signed-off-by: Hal Rosenstock <hal@mellanox.com> Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Sean Hefty [Wed, 11 Feb 2015 00:50:08 +0000 (16:50 -0800)]
rsocket: Fix race in indexer map
Although insertions and removals of rsockets are protected
against accesses to the index map, when reading the map using
a non-rsocket (i.e. normal fd), the reading of the map may
overlap with the removal of an rsocket. This can result in
accessing freed memory.
We can avoid this by not freeing the memory when rsockets
no longer reference an index array. This ensures that the
memory is valid, and protects against reading the memory without
adding locking into the read path.
Problem reported by: Sasha Kotchubievsky <sashakot@mellanox.com>
Sean Hefty [Wed, 11 Feb 2015 00:50:08 +0000 (16:50 -0800)]
rsocket: Fix race in indexer map
Although insertions and removals of rsockets are protected
against accesses to the index map, when reading the map using
a non-rsocket (i.e. normal fd), the reading of the map may
overlap with the removal of an rsocket. This can result in
accessing freed memory.
We can avoid this by not freeing the memory when rsockets
no longer reference an index array. This ensures that the
memory is valid, and protects against reading the memory without
adding locking into the read path.
Problem reported by: Sasha Kotchubievsky <sashakot@mellanox.com>
Sean Hefty [Wed, 11 Feb 2015 00:50:08 +0000 (16:50 -0800)]
rsocket: Fix race in indexer map
Although insertions and removals of rsockets are protected
against accesses to the index map, when reading the map using
a non-rsocket (i.e. normal fd), the reading of the map may
overlap with the removal of an rsocket. This can result in
accessing freed memory.
Problem reported by: Sasha Kotchubievsky <sashakot@mellanox.com>
Sean Hefty [Wed, 11 Feb 2015 00:50:08 +0000 (16:50 -0800)]
rsocket: Fix race in indexer map
Although insertions and removals of rsockets are protected
against accesses to the index map, when reading the map using
a non-rsocket (i.e. normal fd), the reading of the map may
overlap with the removal of an rsocket. This can result in
accessing freed memory.