]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
sctp: use new rhlist interface on sctp transport rhashtable
authorXin Long <lucien.xin@gmail.com>
Tue, 15 Nov 2016 15:23:11 +0000 (23:23 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Nov 2016 04:22:17 +0000 (23:22 -0500)
commit7fda702f9315e6f4a74fee155c540750788a2d66
tree72e32a92f5d972cba66910363f5f3ac87f0dd3de
parent00a636e776328b515b6a3f5f270bec151f4f5c6f
sctp: use new rhlist interface on sctp transport rhashtable

Now sctp transport rhashtable uses hash(lport, dport, daddr) as the key
to hash a node to one chain. If in one host thousands of assocs connect
to one server with the same lport and different laddrs (although it's
not a normal case), all the transports would be hashed into the same
chain.

It may cause to keep returning -EBUSY when inserting a new node, as the
chain is too long and sctp inserts a transport node in a loop, which
could even lead to system hangs there.

The new rhlist interface works for this case that there are many nodes
with the same key in one chain. It puts them into a list then makes this
list be as a node of the chain.

This patch is to replace rhashtable_ interface with rhltable_ interface.
Since a chain would not be too long and it would not return -EBUSY with
this fix when inserting a node, the reinsert loop is also removed here.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/sctp.h
include/net/sctp/structs.h
net/sctp/associola.c
net/sctp/input.c
net/sctp/socket.c