aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorAllan Stephens <Allan.Stephens@windriver.com>2011-01-18 13:53:16 -0500
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-02-23 18:05:12 -0500
commit01d83eddc55c138cbb24a5917d5271c0b24956a1 (patch)
tree4f955e6fa50ac93de90a496749aea82b4411746a /net/tipc
parent77c81e0bb8af3f1a0e5d84dd0346fe57dfe3da27 (diff)
tipc: Clean up tracking of node requesting a broadcast retransmit
Allows the broadcast link to track the node that is requesting a retransmit in a new field dedicated to that purpose. This replaces the existing mechanism that (ab)uses an existing node structure linked list field to do the tracking. Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/bcast.c16
-rw-r--r--net/tipc/bcast.h3
-rw-r--r--net/tipc/link.c2
3 files changed, 17 insertions, 4 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index b4d659df465f..a5eb7dbfa0c3 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -93,6 +93,7 @@ struct bcbearer {
93 * struct bclink - link used for broadcast messages 93 * struct bclink - link used for broadcast messages
94 * @link: (non-standard) broadcast link structure 94 * @link: (non-standard) broadcast link structure
95 * @node: (non-standard) node structure representing b'cast link's peer node 95 * @node: (non-standard) node structure representing b'cast link's peer node
96 * @retransmit_to: node that most recently requested a retransmit
96 * 97 *
97 * Handles sequence numbering, fragmentation, bundling, etc. 98 * Handles sequence numbering, fragmentation, bundling, etc.
98 */ 99 */
@@ -100,6 +101,7 @@ struct bcbearer {
100struct bclink { 101struct bclink {
101 struct link link; 102 struct link link;
102 struct tipc_node node; 103 struct tipc_node node;
104 struct tipc_node *retransmit_to;
103}; 105};
104 106
105 107
@@ -184,6 +186,17 @@ static int bclink_ack_allowed(u32 n)
184 186
185 187
186/** 188/**
189 * tipc_bclink_retransmit_to - get most recent node to request retransmission
190 *
191 * Called with bc_lock locked
192 */
193
194struct tipc_node *tipc_bclink_retransmit_to(void)
195{
196 return bclink->retransmit_to;
197}
198
199/**
187 * bclink_retransmit_pkt - retransmit broadcast packets 200 * bclink_retransmit_pkt - retransmit broadcast packets
188 * @after: sequence number of last packet to *not* retransmit 201 * @after: sequence number of last packet to *not* retransmit
189 * @to: sequence number of last packet to retransmit 202 * @to: sequence number of last packet to retransmit
@@ -444,10 +457,9 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
444 tipc_node_unlock(node); 457 tipc_node_unlock(node);
445 spin_lock_bh(&bc_lock); 458 spin_lock_bh(&bc_lock);
446 bcl->stats.recv_nacks++; 459 bcl->stats.recv_nacks++;
447 bcl->owner->next = node; /* remember requestor */ 460 bclink->retransmit_to = node;
448 bclink_retransmit_pkt(msg_bcgap_after(msg), 461 bclink_retransmit_pkt(msg_bcgap_after(msg),
449 msg_bcgap_to(msg)); 462 msg_bcgap_to(msg));
450 bcl->owner->next = NULL;
451 spin_unlock_bh(&bc_lock); 463 spin_unlock_bh(&bc_lock);
452 } else { 464 } else {
453 tipc_bclink_peek_nack(msg_destnode(msg), 465 tipc_bclink_peek_nack(msg_destnode(msg),
diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h
index 51f8c5326ce6..500c97f1c859 100644
--- a/net/tipc/bcast.h
+++ b/net/tipc/bcast.h
@@ -2,7 +2,7 @@
2 * net/tipc/bcast.h: Include file for TIPC broadcast code 2 * net/tipc/bcast.h: Include file for TIPC broadcast code
3 * 3 *
4 * Copyright (c) 2003-2006, Ericsson AB 4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems 5 * Copyright (c) 2005, 2010-2011, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -90,6 +90,7 @@ void tipc_port_list_free(struct port_list *pl_ptr);
90 90
91int tipc_bclink_init(void); 91int tipc_bclink_init(void);
92void tipc_bclink_stop(void); 92void tipc_bclink_stop(void);
93struct tipc_node *tipc_bclink_retransmit_to(void);
93void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked); 94void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked);
94int tipc_bclink_send_msg(struct sk_buff *buf); 95int tipc_bclink_send_msg(struct sk_buff *buf);
95void tipc_bclink_recv_pkt(struct sk_buff *buf); 96void tipc_bclink_recv_pkt(struct sk_buff *buf);
diff --git a/net/tipc/link.c b/net/tipc/link.c
index d586265e54a4..0cb773b7ee21 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1441,7 +1441,7 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf)
1441 info("Outstanding acks: %lu\n", 1441 info("Outstanding acks: %lu\n",
1442 (unsigned long) TIPC_SKB_CB(buf)->handle); 1442 (unsigned long) TIPC_SKB_CB(buf)->handle);
1443 1443
1444 n_ptr = l_ptr->owner->next; 1444 n_ptr = tipc_bclink_retransmit_to();
1445 tipc_node_lock(n_ptr); 1445 tipc_node_lock(n_ptr);
1446 1446
1447 tipc_addr_string_fill(addr_string, n_ptr->addr); 1447 tipc_addr_string_fill(addr_string, n_ptr->addr);