netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v1] tipc: fix random link resets while adding a second bearer
@ 2016-09-01 14:22 Parthasarathy Bhuvaragan
  2016-09-01 17:13 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Parthasarathy Bhuvaragan @ 2016-09-01 14:22 UTC (permalink / raw)
  To: davem; +Cc: jon.maloy, netdev, tipc-discussion

In a dual bearer configuration, if the second tipc link becomes
active while the first link still has pending nametable "bulk"
updates, it randomly leads to reset of the second link.

When a link is established, the function named_distribute(),
fills the skb based on node mtu (allows room for TUNNEL_PROTOCOL)
with NAME_DISTRIBUTOR message for each PUBLICATION.
However, the function named_distribute() allocates the buffer by
increasing the node mtu by INT_H_SIZE (to insert NAME_DISTRIBUTOR).
This consumes the space allocated for TUNNEL_PROTOCOL.

When establishing the second link, the link shall tunnel all the
messages in the first link queue including the "bulk" update.
As size of the NAME_DISTRIBUTOR messages while tunnelling, exceeds
the link mtu the transmission fails (-EMSGSIZE).

Thus, the synch point based on the message count of the tunnel
packets is never reached leading to link timeout.

In this commit, we adjust the size of name distributor message so that
they can be tunnelled.

Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
---
 net/tipc/name_distr.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 6b626a64b517..a04fe9be1c60 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -62,6 +62,8 @@ static void publ_to_item(struct distr_item *i, struct publication *p)
 
 /**
  * named_prepare_buf - allocate & initialize a publication message
+ *
+ * The buffer returned is of size INT_H_SIZE + payload size
  */
 static struct sk_buff *named_prepare_buf(struct net *net, u32 type, u32 size,
 					 u32 dest)
@@ -141,9 +143,9 @@ static void named_distribute(struct net *net, struct sk_buff_head *list,
 	struct publication *publ;
 	struct sk_buff *skb = NULL;
 	struct distr_item *item = NULL;
-	uint msg_dsz = (tipc_node_get_mtu(net, dnode, 0) / ITEM_SIZE) *
-			ITEM_SIZE;
-	uint msg_rem = msg_dsz;
+	u32 msg_dsz = ((tipc_node_get_mtu(net, dnode, 0) - INT_H_SIZE) /
+			ITEM_SIZE) * ITEM_SIZE;
+	u32 msg_rem = msg_dsz;
 
 	list_for_each_entry(publ, pls, local_list) {
 		/* Prepare next buffer: */
-- 
2.1.4


------------------------------------------------------------------------------

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net v1] tipc: fix random link resets while adding a second bearer
  2016-09-01 14:22 [PATCH net v1] tipc: fix random link resets while adding a second bearer Parthasarathy Bhuvaragan
@ 2016-09-01 17:13 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-09-01 17:13 UTC (permalink / raw)
  To: parthasarathy.bhuvaragan; +Cc: jon.maloy, netdev, tipc-discussion

From: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Date: Thu, 1 Sep 2016 16:22:16 +0200

> In a dual bearer configuration, if the second tipc link becomes
> active while the first link still has pending nametable "bulk"
> updates, it randomly leads to reset of the second link.
> 
> When a link is established, the function named_distribute(),
> fills the skb based on node mtu (allows room for TUNNEL_PROTOCOL)
> with NAME_DISTRIBUTOR message for each PUBLICATION.
> However, the function named_distribute() allocates the buffer by
> increasing the node mtu by INT_H_SIZE (to insert NAME_DISTRIBUTOR).
> This consumes the space allocated for TUNNEL_PROTOCOL.
> 
> When establishing the second link, the link shall tunnel all the
> messages in the first link queue including the "bulk" update.
> As size of the NAME_DISTRIBUTOR messages while tunnelling, exceeds
> the link mtu the transmission fails (-EMSGSIZE).
> 
> Thus, the synch point based on the message count of the tunnel
> packets is never reached leading to link timeout.
> 
> In this commit, we adjust the size of name distributor message so that
> they can be tunnelled.
> 
> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
> Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>

Applied.

------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-01 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-01 14:22 [PATCH net v1] tipc: fix random link resets while adding a second bearer Parthasarathy Bhuvaragan
2016-09-01 17:13 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).