linux/net/rxrpc
David Howells 4a3388c803 rxrpc: Use IDR to allocate client conn IDs on a machine-wide basis
Use the IDR facility to allocate client connection IDs on a machine-wide
basis so that each client connection has a unique identifier.  When the
connection ID space wraps, we advance the epoch by 1, thereby effectively
having a 62-bit ID space.  The IDR facility is then used to look up client
connections during incoming packet routing instead of using an rbtree
rooted on the transport.

This change allows for the removal of the transport in the future and also
means that client connections can be looked up directly in the data-ready
handler by connection ID.

The ID management code is placed in a new file, conn-client.c, to which all
the client connection-specific code will eventually move.

Note that the IDR tree gets very expensive on memory if the connection IDs
are widely scattered throughout the number space, so we shall need to
retire connections that have, say, an ID more than four times the maximum
number of client conns away from the current allocation point to try and
keep the IDs concentrated.  We will also need to retire connections from an
old epoch.

Also note that, for the moment, a pointer to the transport has to be passed
through into the ID allocation function so that we can take a BH lock to
prevent a locking issue against in-BH lookup of client connections.  This
will go away later when RCU is used for server connections also.

Signed-off-by: David Howells <dhowells@redhat.com>
2016-06-22 09:10:02 +01:00
..
af_rxrpc.c rxrpc: Use IDR to allocate client conn IDs on a machine-wide basis 2016-06-22 09:10:02 +01:00
ar-internal.h rxrpc: Use IDR to allocate client conn IDs on a machine-wide basis 2016-06-22 09:10:02 +01:00
call_accept.c rxrpc: Pass sk_buff * rather than rxrpc_host_header * to functions 2016-06-22 09:10:01 +01:00
call_event.c rxrpc: Replace conn->trans->{local,peer} with conn->params.{local,peer} 2016-06-22 09:10:00 +01:00
call_object.c rxrpc: Pass sk_buff * rather than rxrpc_host_header * to functions 2016-06-22 09:10:01 +01:00
conn_client.c rxrpc: Use IDR to allocate client conn IDs on a machine-wide basis 2016-06-22 09:10:02 +01:00
conn_event.c rxrpc: Replace conn->trans->{local,peer} with conn->params.{local,peer} 2016-06-22 09:10:00 +01:00
conn_object.c rxrpc: Use IDR to allocate client conn IDs on a machine-wide basis 2016-06-22 09:10:02 +01:00
input.c rxrpc: Pass sk_buff * rather than rxrpc_host_header * to functions 2016-06-22 09:10:01 +01:00
insecure.c rxrpc: Create a null security type and get rid of conditional calls 2016-04-11 15:34:41 -04:00
Kconfig rxrpc: Absorb the rxkad security module 2016-04-11 15:34:41 -04:00
key.c rxrpc: Use structs to hold connection params and protocol info 2016-06-22 09:09:59 +01:00
local_event.c rxrpc: Rework local endpoint management 2016-06-15 15:38:17 +01:00
local_object.c rxrpc: Rework local endpoint management 2016-06-15 15:38:17 +01:00
Makefile rxrpc: Use IDR to allocate client conn IDs on a machine-wide basis 2016-06-22 09:10:02 +01:00
misc.c rxrpc: Limit the listening backlog 2016-06-10 18:14:47 -07:00
output.c rxrpc: Fix exclusive connection handling 2016-06-22 09:10:00 +01:00
peer_event.c rxrpc: Use the peer record to distribute network errors 2016-06-15 10:15:16 +01:00
peer_object.c rxrpc: fix uninitialized variable use 2016-06-22 09:09:58 +01:00
proc.c rxrpc: Replace conn->trans->{local,peer} with conn->params.{local,peer} 2016-06-22 09:10:00 +01:00
recvmsg.c rxrpc: Replace conn->trans->{local,peer} with conn->params.{local,peer} 2016-06-22 09:10:00 +01:00
rxkad.c rxrpc: Replace conn->trans->{local,peer} with conn->params.{local,peer} 2016-06-22 09:10:00 +01:00
security.c rxrpc: Replace conn->trans->{local,peer} with conn->params.{local,peer} 2016-06-22 09:10:00 +01:00
skbuff.c rxrpc: Rename files matching ar-*.c to git rid of the "ar-" prefix 2016-06-13 12:16:05 +01:00
sysctl.c rxrpc: Limit the listening backlog 2016-06-10 18:14:47 -07:00
transport.c rxrpc: Use IDR to allocate client conn IDs on a machine-wide basis 2016-06-22 09:10:02 +01:00
utils.c rxrpc: Rework peer object handling to use hash table and RCU 2016-06-15 10:12:33 +01:00