Skip to contentSkip to conversation

tipc: fix flow control accounting for implicit connect

PATCH In review Jon Maloy 2 participants 2 messages Sep 25, 2018 – Sep 26, 2018

Subsystems (3)
lore
Share & tools
lore

Jon Maloy

author
#0 lore raw

PATCH 1/1 tipc: fix flow control accounting for implicit connect

From: Parthasarathy Bhuvaragan <[email protected]>

In the case of implicit connect message with data > 1K, the flow control accounting is incorrect. At this state, the socket does not know the peer nodes capability and falls back to legacy flow control by return 1, however the receiver of this message will perform the new block accounting. This leads to a slack and eventually traffic disturbance.

In this commit, we perform tipc_node_get_capabilities() at implicit connect and perform accounting based on the peer's capability.

---
 net/tipc/socket.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/tipc/socket.c +3 -1
index 3f03ddd..b6f99b0 100644
@@ -1419,8 +1419,10 @@ static int __tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dlen)
 	/* Handle implicit connection setup */
 	if (unlikely(dest)) {
 		rc = __tipc_sendmsg(sock, m, dlen);
-		if (dlen && (dlen == rc))
+		if (dlen && dlen == rc) {
+			tsk->peer_caps = tipc_node_get_capabilities(net, dnode);
 			tsk->snt_unacked = tsk_inc(tsk, dlen + msg_hdr_sz(hdr));
+		}
 		return rc;
 	}
 
Signature · 1 line
2.1.4
maintainer
#1 lore raw

From: Jon Maloy <[email protected]>
Date: Tue, 25 Sep 2018 18:21:58 +0200

Quoted 9 lines

From: Parthasarathy Bhuvaragan <[email protected]>

In the case of implicit connect message with data > 1K, the flow control accounting is incorrect. At this state, the socket does not know the peer nodes capability and falls back to legacy flow control by return 1, however the receiver of this message will perform the new block accounting. This leads to a slack and eventually traffic disturbance.

Quoted 5 lines

In this commit, we perform tipc_node_get_capabilities() at implicit connect and perform accounting based on the peer's capability.

Applied and queued up for -stable, thank you.