diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2015-02-05 08:36:43 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-05 16:00:03 -0800 |
commit | 3c724acdd5049907555a831f814bfd5927c3350c (patch) | |
tree | ccf441eecb318238d03e8fa86a7f803d6e3914c7 /net/tipc/name_table.h | |
parent | 708ac32cb5e1305cf3670e147eedcc699d110ed0 (diff) | |
download | blackbird-obmc-linux-3c724acdd5049907555a831f814bfd5927c3350c.tar.gz blackbird-obmc-linux-3c724acdd5049907555a831f814bfd5927c3350c.zip |
tipc: simplify socket multicast reception
The structure 'tipc_port_list' is used to collect port numbers
representing multicast destination socket on a receiving node.
The list is not based on a standard linked list, and is in reality
optimized for the uncommon case that there are more than one
multicast destinations per node. This makes the list handling
unecessarily complex, and as a consequence, even the socket
multicast reception becomes more complex.
In this commit, we replace 'tipc_port_list' with a new 'struct
tipc_plist', which is based on a standard list. We give the new
list stack (push/pop) semantics, someting that simplifies
the implementation of the function tipc_sk_mcast_rcv().
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/name_table.h')
-rw-r--r-- | net/tipc/name_table.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/net/tipc/name_table.h b/net/tipc/name_table.h index f67b3d8d4b2f..52501fdaafa5 100644 --- a/net/tipc/name_table.h +++ b/net/tipc/name_table.h @@ -38,7 +38,7 @@ #define _TIPC_NAME_TABLE_H struct tipc_subscription; -struct tipc_port_list; +struct tipc_plist; /* * TIPC name types reserved for internal TIPC use (both current and planned) @@ -101,7 +101,7 @@ struct sk_buff *tipc_nametbl_get(struct net *net, const void *req_tlv_area, int req_tlv_space); u32 tipc_nametbl_translate(struct net *net, u32 type, u32 instance, u32 *node); int tipc_nametbl_mc_translate(struct net *net, u32 type, u32 lower, u32 upper, - u32 limit, struct tipc_port_list *dports); + u32 limit, struct tipc_plist *dports); struct publication *tipc_nametbl_publish(struct net *net, u32 type, u32 lower, u32 upper, u32 scope, u32 port_ref, u32 key); @@ -118,4 +118,18 @@ void tipc_nametbl_unsubscribe(struct tipc_subscription *s); int tipc_nametbl_init(struct net *net); void tipc_nametbl_stop(struct net *net); +struct tipc_plist { + struct list_head list; + u32 port; +}; + +static inline void tipc_plist_init(struct tipc_plist *pl) +{ + INIT_LIST_HEAD(&pl->list); + pl->port = 0; +} + +void tipc_plist_push(struct tipc_plist *pl, u32 port); +u32 tipc_plist_pop(struct tipc_plist *pl); + #endif |