]> git.baikalelectronics.ru Git - kernel.git/commit
rxrpc: Use RCU to access a peer's service connection tree
authorDavid Howells <dhowells@redhat.com>
Fri, 1 Jul 2016 06:51:50 +0000 (07:51 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 6 Jul 2016 09:51:14 +0000 (10:51 +0100)
commit5ce8b08dddcb42018f8704200f39fd1295f3b15c
treeea5adee605917e9b7b1d3b809dc2458cbd07c271
parentb8892d484deed067510f8b8e78e7a60e25904d4d
rxrpc: Use RCU to access a peer's service connection tree

Move to using RCU access to a peer's service connection tree when routing
an incoming packet.  This is done using a seqlock to trigger retrying of
the tree walk if a change happened.

Further, we no longer get a ref on the connection looked up in the
data_ready handler unless we queue the connection's work item - and then
only if the refcount > 0.

Note that I'm avoiding the use of a hash table for service connections
because each service connection is addressed by a 62-bit number
(constructed from epoch and connection ID >> 2) that would allow the client
to engage in bucket stuffing, given knowledge of the hash algorithm.
Peers, however, are hashed as the network address is less controllable by
the client.  The total number of peers will also be limited in a future
commit.

Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/ar-internal.h
net/rxrpc/conn_client.c
net/rxrpc/conn_object.c
net/rxrpc/conn_service.c
net/rxrpc/input.c
net/rxrpc/peer_object.c