diff options
author | David S. Miller <davem@davemloft.net> | 2015-10-24 09:56:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-24 09:56:54 -0400 |
commit | 687f079addba1ac7f97ce97080c2291bbe8c8dce (patch) | |
tree | 5da9c2e91de35b9111a3badb947416deba5083d8 /net/tipc/node.h | |
parent | ba3e2084f268bdfed7627046e58a2218037e15af (diff) | |
parent | 2af5ae372a4b6d6e2d3314af0e9c865d6d64f8d3 (diff) |
Merge branch 'tipc-next'
Jon Maloy says:
====================
tipc: improve broadcast implementation
The TIPC broadcast link implementation is currently complex and hard to
follow. It also incurs some amount of code and structure duplication,
something that can be reduced significantly with a little effort.
This commit series introduces a number of improvements which address
both the locking structure, the code/structure duplication issue, and
the overall readbility of the code.
The series consists of three main parts:
1-7: Adaptation to the new link structure, and preparation for the next
step. In particular, we want the broadcast transmission link to
have a life cycle that is longer than any of its potential (unicast
and broadcast receive links) users. This eliminates the need to
always test for the presence of this link before accessing it.
8-10: This is what is really new in this series. Commit #9 is by far
the largest and most important one, because it moves most of
the broadcast functionality into link.c, partially reusing the
fields and functionality of the unicast link. The removal of
the "node_map" infrastructure in commit #10 is also an important
achievement.
11-16: Some improvements leveraging the changes made in the previous
commits.
The series needs commit 53387c4e22ac ("tipc: extend broadcast link window size")
and commit e53567948f82 ("tipc: conditionally expand buffer headroom over udp tunnel")
which are both present in 'net' but not yet in 'net-next', to apply cleanly.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.h')
-rw-r--r-- | net/tipc/node.h | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/net/tipc/node.h b/net/tipc/node.h index 344b3e7594fd..6734562d3c6e 100644 --- a/net/tipc/node.h +++ b/net/tipc/node.h | |||
@@ -55,36 +55,18 @@ | |||
55 | enum { | 55 | enum { |
56 | TIPC_NOTIFY_NODE_DOWN = (1 << 3), | 56 | TIPC_NOTIFY_NODE_DOWN = (1 << 3), |
57 | TIPC_NOTIFY_NODE_UP = (1 << 4), | 57 | TIPC_NOTIFY_NODE_UP = (1 << 4), |
58 | TIPC_WAKEUP_BCAST_USERS = (1 << 5), | ||
59 | TIPC_NOTIFY_LINK_UP = (1 << 6), | 58 | TIPC_NOTIFY_LINK_UP = (1 << 6), |
60 | TIPC_NOTIFY_LINK_DOWN = (1 << 7), | 59 | TIPC_NOTIFY_LINK_DOWN = (1 << 7) |
61 | TIPC_BCAST_MSG_EVT = (1 << 9), | ||
62 | TIPC_BCAST_RESET = (1 << 10) | ||
63 | }; | 60 | }; |
64 | 61 | ||
65 | /** | 62 | /* Optional capabilities supported by this code version |
66 | * struct tipc_node_bclink - TIPC node bclink structure | ||
67 | * @acked: sequence # of last outbound b'cast message acknowledged by node | ||
68 | * @last_in: sequence # of last in-sequence b'cast message received from node | ||
69 | * @last_sent: sequence # of last b'cast message sent by node | ||
70 | * @oos_state: state tracker for handling OOS b'cast messages | ||
71 | * @deferred_queue: deferred queue saved OOS b'cast message received from node | ||
72 | * @reasm_buf: broadcast reassembly queue head from node | ||
73 | * @inputq_map: bitmap indicating which inqueues should be kicked | ||
74 | * @recv_permitted: true if node is allowed to receive b'cast messages | ||
75 | */ | 63 | */ |
76 | struct tipc_node_bclink { | 64 | enum { |
77 | u32 acked; | 65 | TIPC_BCAST_SYNCH = (1 << 1) |
78 | u32 last_in; | ||
79 | u32 last_sent; | ||
80 | u32 oos_state; | ||
81 | u32 deferred_size; | ||
82 | struct sk_buff_head deferdq; | ||
83 | struct sk_buff *reasm_buf; | ||
84 | struct sk_buff_head namedq; | ||
85 | bool recv_permitted; | ||
86 | }; | 66 | }; |
87 | 67 | ||
68 | #define TIPC_NODE_CAPABILITIES TIPC_BCAST_SYNCH | ||
69 | |||
88 | struct tipc_link_entry { | 70 | struct tipc_link_entry { |
89 | struct tipc_link *link; | 71 | struct tipc_link *link; |
90 | u32 mtu; | 72 | u32 mtu; |
@@ -92,6 +74,14 @@ struct tipc_link_entry { | |||
92 | struct tipc_media_addr maddr; | 74 | struct tipc_media_addr maddr; |
93 | }; | 75 | }; |
94 | 76 | ||
77 | struct tipc_bclink_entry { | ||
78 | struct tipc_link *link; | ||
79 | struct sk_buff_head inputq1; | ||
80 | struct sk_buff_head arrvq; | ||
81 | struct sk_buff_head inputq2; | ||
82 | struct sk_buff_head namedq; | ||
83 | }; | ||
84 | |||
95 | /** | 85 | /** |
96 | * struct tipc_node - TIPC node structure | 86 | * struct tipc_node - TIPC node structure |
97 | * @addr: network address of node | 87 | * @addr: network address of node |
@@ -104,7 +94,6 @@ struct tipc_link_entry { | |||
104 | * @active_links: bearer ids of active links, used as index into links[] array | 94 | * @active_links: bearer ids of active links, used as index into links[] array |
105 | * @links: array containing references to all links to node | 95 | * @links: array containing references to all links to node |
106 | * @action_flags: bit mask of different types of node actions | 96 | * @action_flags: bit mask of different types of node actions |
107 | * @bclink: broadcast-related info | ||
108 | * @state: connectivity state vs peer node | 97 | * @state: connectivity state vs peer node |
109 | * @sync_point: sequence number where synch/failover is finished | 98 | * @sync_point: sequence number where synch/failover is finished |
110 | * @list: links to adjacent nodes in sorted list of cluster's nodes | 99 | * @list: links to adjacent nodes in sorted list of cluster's nodes |
@@ -124,8 +113,8 @@ struct tipc_node { | |||
124 | struct hlist_node hash; | 113 | struct hlist_node hash; |
125 | int active_links[2]; | 114 | int active_links[2]; |
126 | struct tipc_link_entry links[MAX_BEARERS]; | 115 | struct tipc_link_entry links[MAX_BEARERS]; |
116 | struct tipc_bclink_entry bc_entry; | ||
127 | int action_flags; | 117 | int action_flags; |
128 | struct tipc_node_bclink bclink; | ||
129 | struct list_head list; | 118 | struct list_head list; |
130 | int state; | 119 | int state; |
131 | u16 sync_point; | 120 | u16 sync_point; |