Skip to content

Commit

Permalink
tipc: rename supported flag to recv_permitted
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ying-xue authored and Paul Gortmaker committed Nov 22, 2012
1 parent 818f4da commit 389dd9b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions net/tipc/bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ static void bclink_peek_nack(struct tipc_msg *msg)

tipc_node_lock(n_ptr);

if (n_ptr->bclink.supported &&
if (n_ptr->bclink.recv_permitted &&
(n_ptr->bclink.last_in != n_ptr->bclink.last_sent) &&
(n_ptr->bclink.last_in == msg_bcgap_after(msg)))
n_ptr->bclink.oos_state = 2;
Expand Down Expand Up @@ -429,7 +429,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
goto exit;

tipc_node_lock(node);
if (unlikely(!node->bclink.supported))
if (unlikely(!node->bclink.recv_permitted))
goto unlock;

/* Handle broadcast protocol message */
Expand Down Expand Up @@ -564,7 +564,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)

u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr)
{
return (n_ptr->bclink.supported &&
return (n_ptr->bclink.recv_permitted &&
(tipc_bclink_get_last_sent() != n_ptr->bclink.acked));
}

Expand Down
8 changes: 4 additions & 4 deletions net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -1426,8 +1426,8 @@ static void link_retransmit_failure(struct tipc_link *l_ptr,

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

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

crs = l_ptr->first_out;
Expand Down Expand Up @@ -2067,7 +2067,7 @@ static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf)
}

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

Expand Down
6 changes: 3 additions & 3 deletions net/tipc/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static void node_established_contact(struct tipc_node *n_ptr)

n_ptr->bclink.acked = tipc_bclink_get_last_sent();
tipc_bclink_add_node(n_ptr->addr);
n_ptr->bclink.supported = 1;
n_ptr->bclink.recv_permitted = true;
}

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

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

n_ptr->bclink.supported = 0;
n_ptr->bclink.recv_permitted = false;
}

/* Abort link changeover */
Expand Down
4 changes: 2 additions & 2 deletions net/tipc/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
* @permit_changeover: non-zero if node has redundant links to this system
* @signature: node instance identifier
* @bclink: broadcast-related info
* @supported: non-zero if node supports TIPC b'cast capability
* @acked: sequence # of last outbound b'cast message acknowledged by node
* @last_in: sequence # of last in-sequence b'cast message received from node
* @last_sent: sequence # of last b'cast message sent by node
Expand All @@ -76,6 +75,7 @@
* @deferred_head: oldest OOS b'cast message received from node
* @deferred_tail: newest OOS b'cast message received from node
* @defragm: list of partially reassembled b'cast message fragments from node
* @recv_permitted: true if node is allowed to receive b'cast messages
*/
struct tipc_node {
u32 addr;
Expand All @@ -91,7 +91,6 @@ struct tipc_node {
int permit_changeover;
u32 signature;
struct {
u8 supported;
u32 acked;
u32 last_in;
u32 last_sent;
Expand All @@ -100,6 +99,7 @@ struct tipc_node {
struct sk_buff *deferred_head;
struct sk_buff *deferred_tail;
struct sk_buff *defragm;
bool recv_permitted;
} bclink;
};

Expand Down

0 comments on commit 389dd9b

Please sign in to comment.