Commit 01d83edd authored by Allan Stephens's avatar Allan Stephens Committed by Paul Gortmaker

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: default avatarAllan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent 77c81e0b
...@@ -93,6 +93,7 @@ struct bcbearer { ...@@ -93,6 +93,7 @@ struct bcbearer {
* struct bclink - link used for broadcast messages * struct bclink - link used for broadcast messages
* @link: (non-standard) broadcast link structure * @link: (non-standard) broadcast link structure
* @node: (non-standard) node structure representing b'cast link's peer node * @node: (non-standard) node structure representing b'cast link's peer node
* @retransmit_to: node that most recently requested a retransmit
* *
* Handles sequence numbering, fragmentation, bundling, etc. * Handles sequence numbering, fragmentation, bundling, etc.
*/ */
...@@ -100,6 +101,7 @@ struct bcbearer { ...@@ -100,6 +101,7 @@ struct bcbearer {
struct bclink { struct bclink {
struct link link; struct link link;
struct tipc_node node; struct tipc_node node;
struct tipc_node *retransmit_to;
}; };
...@@ -183,6 +185,17 @@ static int bclink_ack_allowed(u32 n) ...@@ -183,6 +185,17 @@ static int bclink_ack_allowed(u32 n)
} }
/**
* tipc_bclink_retransmit_to - get most recent node to request retransmission
*
* Called with bc_lock locked
*/
struct tipc_node *tipc_bclink_retransmit_to(void)
{
return bclink->retransmit_to;
}
/** /**
* bclink_retransmit_pkt - retransmit broadcast packets * bclink_retransmit_pkt - retransmit broadcast packets
* @after: sequence number of last packet to *not* retransmit * @after: sequence number of last packet to *not* retransmit
...@@ -444,10 +457,9 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) ...@@ -444,10 +457,9 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
tipc_node_unlock(node); tipc_node_unlock(node);
spin_lock_bh(&bc_lock); spin_lock_bh(&bc_lock);
bcl->stats.recv_nacks++; bcl->stats.recv_nacks++;
bcl->owner->next = node; /* remember requestor */ bclink->retransmit_to = node;
bclink_retransmit_pkt(msg_bcgap_after(msg), bclink_retransmit_pkt(msg_bcgap_after(msg),
msg_bcgap_to(msg)); msg_bcgap_to(msg));
bcl->owner->next = NULL;
spin_unlock_bh(&bc_lock); spin_unlock_bh(&bc_lock);
} else { } else {
tipc_bclink_peek_nack(msg_destnode(msg), tipc_bclink_peek_nack(msg_destnode(msg),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* net/tipc/bcast.h: Include file for TIPC broadcast code * net/tipc/bcast.h: Include file for TIPC broadcast code
* *
* Copyright (c) 2003-2006, Ericsson AB * Copyright (c) 2003-2006, Ericsson AB
* Copyright (c) 2005, Wind River Systems * Copyright (c) 2005, 2010-2011, Wind River Systems
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * 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,6 +90,7 @@ void tipc_port_list_free(struct port_list *pl_ptr);
int tipc_bclink_init(void); int tipc_bclink_init(void);
void tipc_bclink_stop(void); void tipc_bclink_stop(void);
struct tipc_node *tipc_bclink_retransmit_to(void);
void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked); void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked);
int tipc_bclink_send_msg(struct sk_buff *buf); int tipc_bclink_send_msg(struct sk_buff *buf);
void tipc_bclink_recv_pkt(struct sk_buff *buf); void tipc_bclink_recv_pkt(struct sk_buff *buf);
......
...@@ -1441,7 +1441,7 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf) ...@@ -1441,7 +1441,7 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf)
info("Outstanding acks: %lu\n", info("Outstanding acks: %lu\n",
(unsigned long) TIPC_SKB_CB(buf)->handle); (unsigned long) TIPC_SKB_CB(buf)->handle);
n_ptr = l_ptr->owner->next; n_ptr = tipc_bclink_retransmit_to();
tipc_node_lock(n_ptr); tipc_node_lock(n_ptr);
tipc_addr_string_fill(addr_string, n_ptr->addr); tipc_addr_string_fill(addr_string, n_ptr->addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment