diff options
author | Octavian Purdila <opurdila@ixiacom.com> | 2009-12-26 06:51:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-26 23:43:57 -0500 |
commit | 6d2e3ea284463d5ab34e9cf2a41d0b8627b95d02 (patch) | |
tree | 86ee780b06adfe388ac64dd66ece598be69b29ec /net/llc/llc_conn.c | |
parent | 0f7b67dd9e1192976f5e5a78934c7a339ff7c45f (diff) |
llc: use a device based hash table to speed up multicast delivery
This patch adds a per SAP device based hash table to solve the
multicast delivery scalability issue when we have large number of
interfaces and a large number of sockets bound to the same SAP.
Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/llc/llc_conn.c')
-rw-r--r-- | net/llc/llc_conn.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c index 77bb3816655e..10cdfe2db830 100644 --- a/net/llc/llc_conn.c +++ b/net/llc/llc_conn.c | |||
@@ -682,10 +682,15 @@ static int llc_find_offset(int state, int ev_type) | |||
682 | */ | 682 | */ |
683 | void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk) | 683 | void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk) |
684 | { | 684 | { |
685 | struct llc_sock *llc = llc_sk(sk); | ||
686 | struct hlist_head *dev_hb = llc_sk_dev_hash(sap, llc->dev->ifindex); | ||
687 | |||
685 | llc_sap_hold(sap); | 688 | llc_sap_hold(sap); |
686 | spin_lock_bh(&sap->sk_lock); | ||
687 | llc_sk(sk)->sap = sap; | 689 | llc_sk(sk)->sap = sap; |
690 | |||
691 | spin_lock_bh(&sap->sk_lock); | ||
688 | sk_nulls_add_node_rcu(sk, &sap->sk_list); | 692 | sk_nulls_add_node_rcu(sk, &sap->sk_list); |
693 | hlist_add_head(&llc->dev_hash_node, dev_hb); | ||
689 | spin_unlock_bh(&sap->sk_lock); | 694 | spin_unlock_bh(&sap->sk_lock); |
690 | } | 695 | } |
691 | 696 | ||
@@ -699,8 +704,11 @@ void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk) | |||
699 | */ | 704 | */ |
700 | void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk) | 705 | void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk) |
701 | { | 706 | { |
707 | struct llc_sock *llc = llc_sk(sk); | ||
708 | |||
702 | spin_lock_bh(&sap->sk_lock); | 709 | spin_lock_bh(&sap->sk_lock); |
703 | sk_nulls_del_node_init_rcu(sk); | 710 | sk_nulls_del_node_init_rcu(sk); |
711 | hlist_del(&llc->dev_hash_node); | ||
704 | spin_unlock_bh(&sap->sk_lock); | 712 | spin_unlock_bh(&sap->sk_lock); |
705 | llc_sap_put(sap); | 713 | llc_sap_put(sap); |
706 | } | 714 | } |