aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorOctavian Purdila <opurdila@ixiacom.com>2009-12-26 11:51:04 +0000
committerDavid S. Miller <davem@davemloft.net>2009-12-26 20:43:57 -0800
commit6d2e3ea284463d5ab34e9cf2a41d0b8627b95d02 (patch)
tree86ee780b06adfe388ac64dd66ece598be69b29ec /include
parent0f7b67dd9e1192976f5e5a78934c7a339ff7c45f (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 'include')
-rw-r--r--include/net/llc.h11
-rw-r--r--include/net/llc_conn.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/include/net/llc.h b/include/net/llc.h
index 1559cf10e87..dbef5917905 100644
--- a/include/net/llc.h
+++ b/include/net/llc.h
@@ -32,6 +32,9 @@ struct llc_addr {
#define LLC_SAP_STATE_INACTIVE 1
#define LLC_SAP_STATE_ACTIVE 2
+#define LLC_SK_DEV_HASH_BITS 6
+#define LLC_SK_DEV_HASH_ENTRIES (1<<LLC_SK_DEV_HASH_BITS)
+
/**
* struct llc_sap - Defines the SAP component
*
@@ -56,8 +59,16 @@ struct llc_sap {
struct list_head node;
spinlock_t sk_lock;
struct hlist_nulls_head sk_list;
+ struct hlist_head sk_dev_hash[LLC_SK_DEV_HASH_ENTRIES];
};
+static inline
+struct hlist_head *llc_sk_dev_hash(struct llc_sap *sap, int ifindex)
+{
+ return &sap->sk_dev_hash[ifindex % LLC_SK_DEV_HASH_ENTRIES];
+}
+
+
#define LLC_DEST_INVALID 0 /* Invalid LLC PDU type */
#define LLC_DEST_SAP 1 /* Type 1 goes here */
#define LLC_DEST_CONN 2 /* Type 2 goes here */
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h
index fe982fd94c4..2f97d8ddce9 100644
--- a/include/net/llc_conn.h
+++ b/include/net/llc_conn.h
@@ -77,6 +77,7 @@ struct llc_sock {
received and caused sending FRMR.
Used for resending FRMR */
u32 cmsg_flags;
+ struct hlist_node dev_hash_node;
};
static inline struct llc_sock *llc_sk(const struct sock *sk)