aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.h
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-10-22 08:51:41 -0400
committerDavid S. Miller <davem@davemloft.net>2015-10-24 09:56:37 -0400
commit5266698661401afc5e4a1a521cf9ba10724d10dd (patch)
treecf3d466a2d9982f403a689e8a0c819c7e3693bde /net/tipc/link.h
parentfd556f209af53b9cdc45df8c467feb235376c4df (diff)
tipc: let broadcast packet reception use new link receive function
The code path for receiving broadcast packets is currently distinct from the unicast path. This leads to unnecessary code and data duplication, something that can be avoided with some effort. We now introduce separate per-peer tipc_link instances for handling broadcast packet reception. Each receive link keeps a pointer to the common, single, broadcast link instance, and can hence handle release and retransmission of send buffers as if they belonged to the own instance. Furthermore, we let each unicast link instance keep a reference to both the pertaining broadcast receive link, and to the common send link. This makes it possible for the unicast links to easily access data for broadcast link synchronization, as well as for carrying acknowledges for received broadcast packets. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/link.h')
-rw-r--r--net/tipc/link.h43
1 files changed, 32 insertions, 11 deletions
diff --git a/net/tipc/link.h b/net/tipc/link.h
index d23329db4b25..28a6396b6d31 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -66,7 +66,8 @@ enum {
66 */ 66 */
67enum { 67enum {
68 TIPC_LINK_UP_EVT = 1, 68 TIPC_LINK_UP_EVT = 1,
69 TIPC_LINK_DOWN_EVT = (1 << 1) 69 TIPC_LINK_DOWN_EVT = (1 << 1),
70 TIPC_LINK_SND_BC_ACK = (1 << 2)
70}; 71};
71 72
72/* Starting value for maximum packet size negotiation on unicast links 73/* Starting value for maximum packet size negotiation on unicast links
@@ -209,6 +210,10 @@ struct tipc_link {
209 /* Broadcast */ 210 /* Broadcast */
210 u16 ackers; 211 u16 ackers;
211 u16 acked; 212 u16 acked;
213 struct tipc_link *bc_rcvlink;
214 struct tipc_link *bc_sndlink;
215 int nack_state;
216 bool bc_peer_is_up;
212 217
213 /* Statistics */ 218 /* Statistics */
214 struct tipc_stats stats; 219 struct tipc_stats stats;
@@ -217,17 +222,21 @@ struct tipc_link {
217bool tipc_link_create(struct tipc_node *n, char *if_name, int bearer_id, 222bool tipc_link_create(struct tipc_node *n, char *if_name, int bearer_id,
218 int tolerance, char net_plane, u32 mtu, int priority, 223 int tolerance, char net_plane, u32 mtu, int priority,
219 int window, u32 session, u32 ownnode, u32 peer, 224 int window, u32 session, u32 ownnode, u32 peer,
220 u16 peer_caps, struct tipc_media_addr *maddr, 225 u16 peer_caps,
221 struct sk_buff_head *inputq, struct sk_buff_head *namedq, 226 struct tipc_media_addr *maddr,
227 struct tipc_link *bc_sndlink,
228 struct tipc_link *bc_rcvlink,
229 struct sk_buff_head *inputq,
230 struct sk_buff_head *namedq,
222 struct tipc_link **link); 231 struct tipc_link **link);
223bool tipc_link_bc_create(struct tipc_node *n, int mtu, int window, 232bool tipc_link_bc_create(struct tipc_node *n, u32 ownnode, u32 peer,
224 u16 peer_caps, struct sk_buff_head *inputq, 233 int mtu, int window, u16 peer_caps,
234 struct sk_buff_head *inputq,
225 struct sk_buff_head *namedq, 235 struct sk_buff_head *namedq,
236 struct tipc_link *bc_sndlink,
226 struct tipc_link **link); 237 struct tipc_link **link);
227void tipc_link_tnl_prepare(struct tipc_link *l, struct tipc_link *tnl, 238void tipc_link_tnl_prepare(struct tipc_link *l, struct tipc_link *tnl,
228 int mtyp, struct sk_buff_head *xmitq); 239 int mtyp, struct sk_buff_head *xmitq);
229void tipc_link_build_bcast_sync_msg(struct tipc_link *l,
230 struct sk_buff_head *xmitq);
231void tipc_link_build_reset_msg(struct tipc_link *l, struct sk_buff_head *xmitq); 240void tipc_link_build_reset_msg(struct tipc_link *l, struct sk_buff_head *xmitq);
232int tipc_link_fsm_evt(struct tipc_link *l, int evt); 241int tipc_link_fsm_evt(struct tipc_link *l, int evt);
233void tipc_link_reset_fragments(struct tipc_link *l_ptr); 242void tipc_link_reset_fragments(struct tipc_link *l_ptr);
@@ -264,9 +273,21 @@ int tipc_nl_parse_link_prop(struct nlattr *prop, struct nlattr *props[]);
264int tipc_link_timeout(struct tipc_link *l, struct sk_buff_head *xmitq); 273int tipc_link_timeout(struct tipc_link *l, struct sk_buff_head *xmitq);
265int tipc_link_rcv(struct tipc_link *l, struct sk_buff *skb, 274int tipc_link_rcv(struct tipc_link *l, struct sk_buff *skb,
266 struct sk_buff_head *xmitq); 275 struct sk_buff_head *xmitq);
267void tipc_link_build_ack_msg(struct tipc_link *l, struct sk_buff_head *xmitq); 276int tipc_link_build_ack_msg(struct tipc_link *l, struct sk_buff_head *xmitq);
268void tipc_link_add_bc_peer(struct tipc_link *l); 277void tipc_link_add_bc_peer(struct tipc_link *snd_l,
269void tipc_link_remove_bc_peer(struct tipc_link *l); 278 struct tipc_link *uc_l,
279 struct sk_buff_head *xmitq);
280void tipc_link_remove_bc_peer(struct tipc_link *snd_l,
281 struct tipc_link *rcv_l,
282 struct sk_buff_head *xmitq);
270int tipc_link_bc_peers(struct tipc_link *l); 283int tipc_link_bc_peers(struct tipc_link *l);
271 284void tipc_link_bc_ack_rcv(struct tipc_link *l, u16 acked,
285 struct sk_buff_head *xmitq);
286void tipc_link_build_bc_sync_msg(struct tipc_link *l,
287 struct sk_buff_head *xmitq);
288void tipc_link_bc_init_rcv(struct tipc_link *l, struct tipc_msg *hdr);
289void tipc_link_bc_sync_rcv(struct tipc_link *l, struct tipc_msg *hdr,
290 struct sk_buff_head *xmitq);
291int tipc_link_bc_nack_rcv(struct tipc_link *l, struct sk_buff *skb,
292 struct sk_buff_head *xmitq);
272#endif 293#endif