Skip to content

Commit 389dd9b

Browse files
ying-xuePaul Gortmaker
authored andcommitted
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>
1 parent 818f4da commit 389dd9b

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎net/tipc/bcast.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static void bclink_peek_nack(struct tipc_msg *msg)
347347

348348
tipc_node_lock(n_ptr);
349349

350-
if (n_ptr->bclink.supported &&
350+
if (n_ptr->bclink.recv_permitted &&
351351
(n_ptr->bclink.last_in != n_ptr->bclink.last_sent) &&
352352
(n_ptr->bclink.last_in == msg_bcgap_after(msg)))
353353
n_ptr->bclink.oos_state = 2;
@@ -429,7 +429,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
429429
goto exit;
430430

431431
tipc_node_lock(node);
432-
if (unlikely(!node->bclink.supported))
432+
if (unlikely(!node->bclink.recv_permitted))
433433
goto unlock;
434434

435435
/* Handle broadcast protocol message */
@@ -564,7 +564,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
564564

565565
u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr)
566566
{
567-
return (n_ptr->bclink.supported &&
567+
return (n_ptr->bclink.recv_permitted &&
568568
(tipc_bclink_get_last_sent() != n_ptr->bclink.acked));
569569
}
570570

‎net/tipc/link.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,8 +1426,8 @@ static void link_retransmit_failure(struct tipc_link *l_ptr,
14261426

14271427
tipc_addr_string_fill(addr_string, n_ptr->addr);
14281428
pr_info("Broadcast link info for %s\n", addr_string);
1429-
pr_info("Supported: %d, Acked: %u\n",
1430-
n_ptr->bclink.supported,
1429+
pr_info("Reception permitted: %d, Acked: %u\n",
1430+
n_ptr->bclink.recv_permitted,
14311431
n_ptr->bclink.acked);
14321432
pr_info("Last in: %u, Oos state: %u, Last sent: %u\n",
14331433
n_ptr->bclink.last_in,
@@ -1640,7 +1640,7 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr)
16401640
ackd = msg_ack(msg);
16411641

16421642
/* Release acked messages */
1643-
if (n_ptr->bclink.supported)
1643+
if (n_ptr->bclink.recv_permitted)
16441644
tipc_bclink_acknowledge(n_ptr, msg_bcast_ack(msg));
16451645

16461646
crs = l_ptr->first_out;
@@ -2067,7 +2067,7 @@ static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf)
20672067
}
20682068

20692069
/* Protocol message before retransmits, reduce loss risk */
2070-
if (l_ptr->owner->bclink.supported)
2070+
if (l_ptr->owner->bclink.recv_permitted)
20712071
tipc_bclink_update_link_state(l_ptr->owner,
20722072
msg_last_bcast(msg));
20732073

‎net/tipc/node.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static void node_established_contact(struct tipc_node *n_ptr)
266266

267267
n_ptr->bclink.acked = tipc_bclink_get_last_sent();
268268
tipc_bclink_add_node(n_ptr->addr);
269-
n_ptr->bclink.supported = 1;
269+
n_ptr->bclink.recv_permitted = true;
270270
}
271271

272272
static void node_name_purge_complete(unsigned long node_addr)
@@ -292,7 +292,7 @@ static void node_lost_contact(struct tipc_node *n_ptr)
292292
tipc_addr_string_fill(addr_string, n_ptr->addr));
293293

294294
/* Flush broadcast link info associated with lost node */
295-
if (n_ptr->bclink.supported) {
295+
if (n_ptr->bclink.recv_permitted) {
296296
while (n_ptr->bclink.deferred_head) {
297297
struct sk_buff *buf = n_ptr->bclink.deferred_head;
298298
n_ptr->bclink.deferred_head = buf->next;
@@ -308,7 +308,7 @@ static void node_lost_contact(struct tipc_node *n_ptr)
308308
tipc_bclink_remove_node(n_ptr->addr);
309309
tipc_bclink_acknowledge(n_ptr, INVALID_LINK_SEQ);
310310

311-
n_ptr->bclink.supported = 0;
311+
n_ptr->bclink.recv_permitted = false;
312312
}
313313

314314
/* Abort link changeover */

‎net/tipc/node.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
* @permit_changeover: non-zero if node has redundant links to this system
6868
* @signature: node instance identifier
6969
* @bclink: broadcast-related info
70-
* @supported: non-zero if node supports TIPC b'cast capability
7170
* @acked: sequence # of last outbound b'cast message acknowledged by node
7271
* @last_in: sequence # of last in-sequence b'cast message received from node
7372
* @last_sent: sequence # of last b'cast message sent by node
@@ -76,6 +75,7 @@
7675
* @deferred_head: oldest OOS b'cast message received from node
7776
* @deferred_tail: newest OOS b'cast message received from node
7877
* @defragm: list of partially reassembled b'cast message fragments from node
78+
* @recv_permitted: true if node is allowed to receive b'cast messages
7979
*/
8080
struct tipc_node {
8181
u32 addr;
@@ -91,7 +91,6 @@ struct tipc_node {
9191
int permit_changeover;
9292
u32 signature;
9393
struct {
94-
u8 supported;
9594
u32 acked;
9695
u32 last_in;
9796
u32 last_sent;
@@ -100,6 +99,7 @@ struct tipc_node {
10099
struct sk_buff *deferred_head;
101100
struct sk_buff *deferred_tail;
102101
struct sk_buff *defragm;
102+
bool recv_permitted;
103103
} bclink;
104104
};
105105

0 commit comments

Comments
 (0)