Sean Hefty [Wed, 7 Apr 2010 00:26:25 +0000 (17:26 -0700)]
rdma/cm: set num_paths when manually assigning path records
We manually assigning the path records to use for a connection,
save the number of paths that were saved. Otherwise, checks
against num_path will show 0, even though path record data is
available.
This was discovered by manually setting the path records from
user space, then querying the kernel to see if the correct
path records were assigned.
Sean Hefty [Wed, 7 Apr 2010 00:26:13 +0000 (17:26 -0700)]
rdma/ucm: allow user space to specify AF_IB when joining multicast
Allow user space applications to join multicast groups using MGIDs
directly. MGIDs may be passed using AF_IB addresses. Since the
current multicast join command only supports addresses as large as
sockaddr_in6, define a new structure for joining addresses specified
using sockaddr_ib.
Since port space IB allows the user to specify the qkey when
resolving a remote UD QP address, when joining the multicast
group use the qkey value, if one has been assigned.
Sean Hefty [Wed, 7 Apr 2010 00:22:43 +0000 (17:22 -0700)]
rdma/ucm: allow user space to pass AF_IB into resolve
Allow user space applications to call resolve_addr using
AF_IB. To support sockaddr_ib, we need to define a new
structure capable of handling the larger address size.
Sean Hefty [Wed, 7 Apr 2010 00:22:42 +0000 (17:22 -0700)]
rdma/ucm: allow user space to bind to AF_IB
Support user space binding to addresses using AF_IB. Since
sockaddr_ib is larger than sockaddr_in6, we need to define
a larger structure when binding using AF_IB. This time we
use sockaddr_storage to cover future cases.
Sean Hefty [Wed, 7 Apr 2010 00:22:41 +0000 (17:22 -0700)]
rdma/ucm: name changes to indicate only IP addresses supported
Several commands into the RDMA CM from user space are
restricted to supporting addresses which fit into a sockaddr_in6
structure: bind address, resolve address, and join multicast.
With the addition of AF_IB, we need to support addresses
which are larger than sockaddr_in6. This will be done by
adding new commands that exchange address information using
sockaddr_storage. However, to support existing applications,
we maintain the current commands and structures, but rename
them to indicate that they only support IPv4 and v6 addresses.
Sean Hefty [Wed, 7 Apr 2010 00:22:41 +0000 (17:22 -0700)]
rdma/ucm: add ability to query GID addresses
Part of address resolution is mapping IP addresses to IB GIDs.
With the changes to support querying larger addresses and more
path records, also provide a way to query IB GIDs after
resolution completes.
Sean Hefty [Wed, 7 Apr 2010 00:22:38 +0000 (17:22 -0700)]
rdma/ucm: support querying when IB paths are not reversible
The current query_route call can return up to two path records.
The assumption being that one is the primary path, with optional
support for an alternate path. In both cases, the paths are
assumed to be reversible and are used to send CM MADs.
With the ability to manually set IB path data, the rdma cm
can eventually be capable of using up to 6 paths per
connection:
forward primary, reverse primary,
forward alternate, reverse alternate,
reversible primary path for CM MADs
reversible alternate path for CM MADs.
(It is unclear at this time if IB routing will complicate this.)
In order to handle more flexible routing topologies, add a new
command to report any number of paths.
Sean Hefty [Wed, 7 Apr 2010 00:22:38 +0000 (17:22 -0700)]
ib/sa: export function to pack a path record into wire format
Allow converting from struct ib_sa_path_rec to the IB defined
SA path record wire format. This will be used to report path
data from the rdma cm into user space.
Sean Hefty [Wed, 7 Apr 2010 00:22:37 +0000 (17:22 -0700)]
rdma/ucm: support querying for AF_IB addresses
The sockaddr structure for AF_IB is larger than sockaddr_in6.
The rdma cm user space ABI uses the latter to exchange address
information between user space and the kernel.
To support querying for larger addresses, define a new query
command that exchanges data using sockaddr_storage, rather
than sockaddr_in6. Unlike the existing query_route command,
the new command only returns address information. Route
(i.e. path record) data is separated.
Sean Hefty [Wed, 7 Apr 2010 00:22:35 +0000 (17:22 -0700)]
rdma/cm: expose private data when using AF_IB
If the source or destination address is AF_IB, then do not
reserve a portion of the private data in the IB CM REQ or SIDR
REQ messages for the cma header. Instead, all private data
should be exported to the user. When AF_IB is used, the
rdma cm does not have sufficient information to fill in the
cma header. Additionally, this will be necessary to support
any IB connection through the rdma cm interface,
Sean Hefty [Wed, 7 Apr 2010 00:22:33 +0000 (17:22 -0700)]
rdma/cm: add support for AF_IB to cma_get_service_id
cma_get_service_id forms the service ID based on the port space
and port number of the rdma_cm_id. Extend the call to support
AF_IB, which contains the service ID directly. This will
be needed to support any arbitrary SID.
Sean Hefty [Wed, 7 Apr 2010 00:22:33 +0000 (17:22 -0700)]
rdma/cm: add support for AF_IB to rdma_resolve_addr
Allow the user to specify the remote address using AF_IB format.
When AF_IB is used, the remote address simply needs to be recorded,
and no resolution using ARP is done. The local address may still
need to be resolved however.
Sean Hefty [Wed, 7 Apr 2010 00:22:31 +0000 (17:22 -0700)]
rdma/cm: do not modify sa_family when setting loopback address
cma_resolve_loopback is called after an rdma_cm_id has been
bound to a specific sa_family and port. Once the
source sa_family for the id has been set, do not modify it.
Only the actual IP address portion of the source address
needs to be set.
As part of this fix, we can simplify setting the source address
by moving the loopback address assignment from cma_resolve_loopback
to cma_bind_loopback. cma_bind_loopback is only invoked when
the source address is the loopback address.
Finally, add loopback support for AF_IB as part of the change.
Sean Hefty [Wed, 7 Apr 2010 00:22:30 +0000 (17:22 -0700)]
rdma/cm: Allow user to specify AF_IB when binding
Modify rdma_bind_addr to allow the user to specify AF_IB when
binding to a device. AF_IB indicates that the user is not
mapping an IP address to the native IB addressing. (The mapping
may have already been done, or is not needed.)
Sean Hefty [Wed, 7 Apr 2010 00:22:12 +0000 (17:22 -0700)]
rdma/cm: set qkey for port space IB
Allow the user to specify the qkey when using port space IB. The
qkey is added to struct rdma_ucm_conn_param in place of a reserved
field, but for backwards compatability, is only accessed if the
associated rdma_cm_id is using the IB port space.
Sean Hefty [Wed, 31 Mar 2010 00:22:34 +0000 (16:22 -0800)]
rdma/ucm: change event handling based on port space
The rdma_ucm handles events differently based on the port space
of the associated rdma_cm_id. In order to support RDMA_PS_IB,
fix the handling based on the event.
Sean Hefty [Wed, 31 Mar 2010 00:22:33 +0000 (16:22 -0800)]
rdma/ucm: add support for RDMA_PS_IB when creating an ID
In order to support RDMA_PS_IB, we need to know the qp type
to associated with the rdma cm id. Receive the qp type from
user space using currently reserved fields. Previous kernels
do not support RDMA_PS_IB, so we only read out the qp type
data if PS_IB has been selected. This avoids issues reading
uninitialized data from existing applications.
Sean Hefty [Wed, 31 Mar 2010 00:20:09 +0000 (16:20 -0800)]
rdma/cm: specify QP type when creating an ID
The rdma_cm infers the QP type from the port space selected by the
user. In order to support RDMA_PS_IB, we need to know which
QP type the user intends to support in order to perform the
correction operation, such as sending a REQ versus SIDR.
Modify rdma_create_id to allow the user to specify the QP type,
and use it to make our selections of datagram versus connected
mode.
Sean Hefty [Wed, 31 Mar 2010 00:01:07 +0000 (16:01 -0800)]
rdma/cm: update port reservation to support AF_IB
Update the port reservation code path to support AF_IB addresses.
Define a new port space, RDMA_PS_IB, for AF_IB addressing.
The AF_IB port space is a 64-bit service id (SID), which the
user can control through the use of a mask. The rdma_cm
will assign values to the unmasked portions of the SID
when an rdma_cm_id is bound to an AF_IB address.
Because the IB spec divides the SID range into several regions,
a SID/mask combination may fall into one of the existing
port space ranges as defined by the RDMA CM IP Annex. We need
to coordinate port reservation between RDMA_PS_IB and
RDMA_PS_TCP/RDMA_PS_UDP.
Sean Hefty [Wed, 17 Mar 2010 18:10:23 +0000 (10:10 -0800)]
ib/addr: add AF_IB support to ip_addr_size
Add support for AF_IB to ip_addr_size, and rename the function
to account for the change. Give the compiler more control over
whether the call should be inline or not by moving the definition
into the .c file, removing the static inline, and exporting it.
Sean Hefty [Wed, 17 Mar 2010 18:09:09 +0000 (10:09 -0800)]
rdma/cm: include AF_IB in loopback and any address checks
Enhance checks for loopback and any address to support AF_IB
in addition to AF_INET and AF_INT6. This will allow future
patches to use AF_IB when binding and resolving addresses.
Sean Hefty [Wed, 17 Mar 2010 18:09:03 +0000 (10:09 -0800)]
rdma/cm: fix handling of ipv6 addressing in cma_use_port
cma_use_port is coded assuming that the sockaddr is an ipv4 address.
Since ipv6 addressing is supported, and also to support other address
families, make the code more generic in its address handling.
commit 672917dcc78 ("cpuidle: menu governor: reduce latency on exit")
added an optimization, where the analysis on the past idle period moved
from the end of idle, to the beginning of the new idle.
Unfortunately, this optimization had a bug where it zeroed one key
variable for new use, that is needed for the analysis. The fix is
simple, zero the variable after doing the work from the previous idle.
During the audit of the code that found this issue, another issue was
also found; the ->measured_us data structure member is never set, a
local variable is always used instead.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Cc: Corrado Zoccolo <czoccolo@gmail.com> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Fri, 7 May 2010 21:11:40 +0000 (14:11 -0700)]
Merge branch 'for-linus' of git://neil.brown.name/md
* 'for-linus' of git://neil.brown.name/md:
md: restore ability of spare drives to spin down.
md/raid6: Fix raid-6 read-error correction in degraded state