diff options
author | Ying Xue <ying.xue@windriver.com> | 2012-11-16 00:51:30 -0500 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-11-22 07:50:51 -0500 |
commit | 389dd9bcf65e10929cedfeb79c49bd02069b8899 (patch) | |
tree | 13941aa4eb7ce60d2cf07aab234dcfd2d29f7a07 /net | |
parent | 818f4da526656a100c637b098be06316fd4624e4 (diff) |
tipc: rename supported flag to recv_permitted
Rename the "supported" flag in bclink structure to "recv_permitted"
to better reflect what it is used for. When this flag is set for a
given node, we are permitted to receive and acknowledge broadcast
messages from that node. Convert it to a bool at the same time,
since it is not used to store any numerical values.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/tipc/bcast.c | 6 | ||||
-rw-r--r-- | net/tipc/link.c | 8 | ||||
-rw-r--r-- | net/tipc/node.c | 6 | ||||
-rw-r--r-- | net/tipc/node.h | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 40da098eeb39..54f89f90ac33 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -347,7 +347,7 @@ static void bclink_peek_nack(struct tipc_msg *msg) | |||
347 | 347 | ||
348 | tipc_node_lock(n_ptr); | 348 | tipc_node_lock(n_ptr); |
349 | 349 | ||
350 | if (n_ptr->bclink.supported && | 350 | if (n_ptr->bclink.recv_permitted && |
351 | (n_ptr->bclink.last_in != n_ptr->bclink.last_sent) && | 351 | (n_ptr->bclink.last_in != n_ptr->bclink.last_sent) && |
352 | (n_ptr->bclink.last_in == msg_bcgap_after(msg))) | 352 | (n_ptr->bclink.last_in == msg_bcgap_after(msg))) |
353 | n_ptr->bclink.oos_state = 2; | 353 | n_ptr->bclink.oos_state = 2; |
@@ -429,7 +429,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) | |||
429 | goto exit; | 429 | goto exit; |
430 | 430 | ||
431 | tipc_node_lock(node); | 431 | tipc_node_lock(node); |
432 | if (unlikely(!node->bclink.supported)) | 432 | if (unlikely(!node->bclink.recv_permitted)) |
433 | goto unlock; | 433 | goto unlock; |
434 | 434 | ||
435 | /* Handle broadcast protocol message */ | 435 | /* Handle broadcast protocol message */ |
@@ -564,7 +564,7 @@ exit: | |||
564 | 564 | ||
565 | u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr) | 565 | u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr) |
566 | { | 566 | { |
567 | return (n_ptr->bclink.supported && | 567 | return (n_ptr->bclink.recv_permitted && |
568 | (tipc_bclink_get_last_sent() != n_ptr->bclink.acked)); | 568 | (tipc_bclink_get_last_sent() != n_ptr->bclink.acked)); |
569 | } | 569 | } |
570 | 570 | ||
diff --git a/net/tipc/link.c b/net/tipc/link.c index f3a078fe70c8..20f128fc2be1 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -1426,8 +1426,8 @@ static void link_retransmit_failure(struct tipc_link *l_ptr, | |||
1426 | 1426 | ||
1427 | tipc_addr_string_fill(addr_string, n_ptr->addr); | 1427 | tipc_addr_string_fill(addr_string, n_ptr->addr); |
1428 | pr_info("Broadcast link info for %s\n", addr_string); | 1428 | pr_info("Broadcast link info for %s\n", addr_string); |
1429 | pr_info("Supported: %d, Acked: %u\n", | 1429 | pr_info("Reception permitted: %d, Acked: %u\n", |
1430 | n_ptr->bclink.supported, | 1430 | n_ptr->bclink.recv_permitted, |
1431 | n_ptr->bclink.acked); | 1431 | n_ptr->bclink.acked); |
1432 | pr_info("Last in: %u, Oos state: %u, Last sent: %u\n", | 1432 | pr_info("Last in: %u, Oos state: %u, Last sent: %u\n", |
1433 | n_ptr->bclink.last_in, | 1433 | n_ptr->bclink.last_in, |
@@ -1640,7 +1640,7 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr) | |||
1640 | ackd = msg_ack(msg); | 1640 | ackd = msg_ack(msg); |
1641 | 1641 | ||
1642 | /* Release acked messages */ | 1642 | /* Release acked messages */ |
1643 | if (n_ptr->bclink.supported) | 1643 | if (n_ptr->bclink.recv_permitted) |
1644 | tipc_bclink_acknowledge(n_ptr, msg_bcast_ack(msg)); | 1644 | tipc_bclink_acknowledge(n_ptr, msg_bcast_ack(msg)); |
1645 | 1645 | ||
1646 | crs = l_ptr->first_out; | 1646 | crs = l_ptr->first_out; |
@@ -2067,7 +2067,7 @@ static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf) | |||
2067 | } | 2067 | } |
2068 | 2068 | ||
2069 | /* Protocol message before retransmits, reduce loss risk */ | 2069 | /* Protocol message before retransmits, reduce loss risk */ |
2070 | if (l_ptr->owner->bclink.supported) | 2070 | if (l_ptr->owner->bclink.recv_permitted) |
2071 | tipc_bclink_update_link_state(l_ptr->owner, | 2071 | tipc_bclink_update_link_state(l_ptr->owner, |
2072 | msg_last_bcast(msg)); | 2072 | msg_last_bcast(msg)); |
2073 | 2073 | ||
diff --git a/net/tipc/node.c b/net/tipc/node.c index 6f3e9b35d27f..283a59f0f1c8 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -266,7 +266,7 @@ static void node_established_contact(struct tipc_node *n_ptr) | |||
266 | 266 | ||
267 | n_ptr->bclink.acked = tipc_bclink_get_last_sent(); | 267 | n_ptr->bclink.acked = tipc_bclink_get_last_sent(); |
268 | tipc_bclink_add_node(n_ptr->addr); | 268 | tipc_bclink_add_node(n_ptr->addr); |
269 | n_ptr->bclink.supported = 1; | 269 | n_ptr->bclink.recv_permitted = true; |
270 | } | 270 | } |
271 | 271 | ||
272 | static void node_name_purge_complete(unsigned long node_addr) | 272 | static void node_name_purge_complete(unsigned long node_addr) |
@@ -292,7 +292,7 @@ static void node_lost_contact(struct tipc_node *n_ptr) | |||
292 | tipc_addr_string_fill(addr_string, n_ptr->addr)); | 292 | tipc_addr_string_fill(addr_string, n_ptr->addr)); |
293 | 293 | ||
294 | /* Flush broadcast link info associated with lost node */ | 294 | /* Flush broadcast link info associated with lost node */ |
295 | if (n_ptr->bclink.supported) { | 295 | if (n_ptr->bclink.recv_permitted) { |
296 | while (n_ptr->bclink.deferred_head) { | 296 | while (n_ptr->bclink.deferred_head) { |
297 | struct sk_buff *buf = n_ptr->bclink.deferred_head; | 297 | struct sk_buff *buf = n_ptr->bclink.deferred_head; |
298 | n_ptr->bclink.deferred_head = buf->next; | 298 | n_ptr->bclink.deferred_head = buf->next; |
@@ -308,7 +308,7 @@ static void node_lost_contact(struct tipc_node *n_ptr) | |||
308 | tipc_bclink_remove_node(n_ptr->addr); | 308 | tipc_bclink_remove_node(n_ptr->addr); |
309 | tipc_bclink_acknowledge(n_ptr, INVALID_LINK_SEQ); | 309 | tipc_bclink_acknowledge(n_ptr, INVALID_LINK_SEQ); |
310 | 310 | ||
311 | n_ptr->bclink.supported = 0; | 311 | n_ptr->bclink.recv_permitted = false; |
312 | } | 312 | } |
313 | 313 | ||
314 | /* Abort link changeover */ | 314 | /* Abort link changeover */ |
diff --git a/net/tipc/node.h b/net/tipc/node.h index 3ac905f36b03..3c189b35b102 100644 --- a/net/tipc/node.h +++ b/net/tipc/node.h | |||
@@ -67,7 +67,6 @@ | |||
67 | * @permit_changeover: non-zero if node has redundant links to this system | 67 | * @permit_changeover: non-zero if node has redundant links to this system |
68 | * @signature: node instance identifier | 68 | * @signature: node instance identifier |
69 | * @bclink: broadcast-related info | 69 | * @bclink: broadcast-related info |
70 | * @supported: non-zero if node supports TIPC b'cast capability | ||
71 | * @acked: sequence # of last outbound b'cast message acknowledged by node | 70 | * @acked: sequence # of last outbound b'cast message acknowledged by node |
72 | * @last_in: sequence # of last in-sequence b'cast message received from node | 71 | * @last_in: sequence # of last in-sequence b'cast message received from node |
73 | * @last_sent: sequence # of last b'cast message sent by node | 72 | * @last_sent: sequence # of last b'cast message sent by node |
@@ -76,6 +75,7 @@ | |||
76 | * @deferred_head: oldest OOS b'cast message received from node | 75 | * @deferred_head: oldest OOS b'cast message received from node |
77 | * @deferred_tail: newest OOS b'cast message received from node | 76 | * @deferred_tail: newest OOS b'cast message received from node |
78 | * @defragm: list of partially reassembled b'cast message fragments from node | 77 | * @defragm: list of partially reassembled b'cast message fragments from node |
78 | * @recv_permitted: true if node is allowed to receive b'cast messages | ||
79 | */ | 79 | */ |
80 | struct tipc_node { | 80 | struct tipc_node { |
81 | u32 addr; | 81 | u32 addr; |
@@ -91,7 +91,6 @@ struct tipc_node { | |||
91 | int permit_changeover; | 91 | int permit_changeover; |
92 | u32 signature; | 92 | u32 signature; |
93 | struct { | 93 | struct { |
94 | u8 supported; | ||
95 | u32 acked; | 94 | u32 acked; |
96 | u32 last_in; | 95 | u32 last_in; |
97 | u32 last_sent; | 96 | u32 last_sent; |
@@ -100,6 +99,7 @@ struct tipc_node { | |||
100 | struct sk_buff *deferred_head; | 99 | struct sk_buff *deferred_head; |
101 | struct sk_buff *deferred_tail; | 100 | struct sk_buff *deferred_tail; |
102 | struct sk_buff *defragm; | 101 | struct sk_buff *defragm; |
102 | bool recv_permitted; | ||
103 | } bclink; | 103 | } bclink; |
104 | }; | 104 | }; |
105 | 105 | ||