summaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-10-15 14:52:45 -0400
committerDavid S. Miller <davem@davemloft.net>2015-10-15 23:55:22 -0700
commit282b3a056225b35024246f63feb91d769d714dad (patch)
tree0e29576cbef2318c0ddaf404c5f46c7b997ef7fe /net/tipc/node.c
parent73f646cec35477b5099d7e952297cb9e1855be45 (diff)
downloadblackbird-obmc-linux-282b3a056225b35024246f63feb91d769d714dad.tar.gz
blackbird-obmc-linux-282b3a056225b35024246f63feb91d769d714dad.zip
tipc: send out RESET immediately when link goes down
When a link is taken down because of a node local event, such as disabling of a bearer or an interface, we currently leave it to the peer node to discover the broken communication. The default time for such failure discovery is 1.5-2 seconds. If we instead allow the terminating link endpoint to send out a RESET message at the moment it is reset, we can achieve the impression that both endpoints are going down instantly. Since this is a very common scenario, we find it worthwhile to make this small modification. Apart from letting the link produce the said message, we also have to ensure that the interface is able to transmit it before TIPC is detached. We do this by performing the disabling of a bearer in three steps: 1) Disable reception of TIPC packets from the interface in question. 2) Take down the links, while allowing them so send out a RESET message. 3) Disable transmission of TIPC packets on the interface. Apart from this, we now have to react on the NETDEV_GOING_DOWN event, instead of as currently the NEDEV_DOWN event, to ensure that such transmission is possible during the teardown phase. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 656b5791f1a5..fba6e1af28e8 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -41,7 +41,7 @@
#include "socket.h"
#include "bcast.h"
#include "discover.h"
-
+#define pr_debug printk
/* Node FSM states and events:
*/
enum {
@@ -421,6 +421,8 @@ static void __tipc_node_link_down(struct tipc_node *n, int *bearer_id,
if (!tipc_node_is_up(n)) {
tipc_link_reset(l);
+ tipc_link_build_reset_msg(l, xmitq);
+ *maddr = &n->links[*bearer_id].maddr;
node_lost_contact(n, &le->inputq);
return;
}
@@ -463,7 +465,6 @@ static void tipc_node_link_down(struct tipc_node *n, int bearer_id, bool delete)
tipc_link_fsm_evt(l, LINK_RESET_EVT);
}
tipc_node_unlock(n);
-
tipc_bearer_xmit(n->net, bearer_id, &xmitq, maddr);
tipc_sk_rcv(n->net, &le->inputq);
}
OpenPOWER on IntegriCloud