summaryrefslogtreecommitdiffstats
path: root/include/net/sctp/sctp.h
diff options
context:
space:
mode:
authorXin Long2016-11-15 16:23:11 +0100
committerDavid S. Miller2016-11-17 05:22:17 +0100
commit7fda702f9315e6f4a74fee155c540750788a2d66 (patch)
tree72e32a92f5d972cba66910363f5f3ac87f0dd3de /include/net/sctp/sctp.h
parentMerge branch 'bnxt_en-next' (diff)
downloadkernel-qcow2-linux-7fda702f9315e6f4a74fee155c540750788a2d66.tar.gz
kernel-qcow2-linux-7fda702f9315e6f4a74fee155c540750788a2d66.tar.xz
kernel-qcow2-linux-7fda702f9315e6f4a74fee155c540750788a2d66.zip
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>
Diffstat (limited to 'include/net/sctp/sctp.h')
-rw-r--r--include/net/sctp/sctp.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 31acc3f4f132..f0dcaebebddb 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -164,7 +164,7 @@ void sctp_backlog_migrate(struct sctp_association *assoc,
struct sock *oldsk, struct sock *newsk);
int sctp_transport_hashtable_init(void);
void sctp_transport_hashtable_destroy(void);
-void sctp_hash_transport(struct sctp_transport *t);
+int sctp_hash_transport(struct sctp_transport *t);
void sctp_unhash_transport(struct sctp_transport *t);
struct sctp_transport *sctp_addrs_lookup_transport(
struct net *net,