All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next] tipc: Add a missing case of TIPC_DIRECT_MSG type
@ 2020-03-26  2:50 Hoang Le
  2020-03-26 18:21 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Hoang Le @ 2020-03-26  2:50 UTC (permalink / raw)
  To: netdev, ying.xue; +Cc: maloy, jmaloy, Tuong Lien

In the commit f73b12812a3d
("tipc: improve throughput between nodes in netns"), we're missing a check
to handle TIPC_DIRECT_MSG type, it's still using old sending mechanism for
this message type. So, throughput improvement is not significant as
expected.

Besides that, when sending a large message with that type, we're also
handle wrong receiving queue, it should be enqueued in socket receiving
instead of multicast messages.

Fix this by adding the missing case for TIPC_DIRECT_MSG.

Fixes: f73b12812a3d ("tipc: improve throughput between nodes in netns")
Reported-by: Tuong Lien <tuong.t.lien@dektech.com.au>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
Acked-by: Jon Maloy <jmaloy@redhat.com>
---
 net/tipc/msg.h    | 5 +++++
 net/tipc/node.c   | 3 ++-
 net/tipc/socket.c | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 6d466ebdb64f..871feadbbc19 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -394,6 +394,11 @@ static inline u32 msg_connected(struct tipc_msg *m)
 	return msg_type(m) == TIPC_CONN_MSG;
 }
 
+static inline u32 msg_direct(struct tipc_msg *m)
+{
+	return msg_type(m) == TIPC_DIRECT_MSG;
+}
+
 static inline u32 msg_errcode(struct tipc_msg *m)
 {
 	return msg_bits(m, 1, 25, 0xf);
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 0c88778c88b5..10292c942384 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1586,7 +1586,8 @@ static void tipc_lxc_xmit(struct net *peer_net, struct sk_buff_head *list)
 	case TIPC_MEDIUM_IMPORTANCE:
 	case TIPC_HIGH_IMPORTANCE:
 	case TIPC_CRITICAL_IMPORTANCE:
-		if (msg_connected(hdr) || msg_named(hdr)) {
+		if (msg_connected(hdr) || msg_named(hdr) ||
+		    msg_direct(hdr)) {
 			tipc_loopback_trace(peer_net, list);
 			spin_lock_init(&list->lock);
 			tipc_sk_rcv(peer_net, list);
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 693e8902161e..87466607097f 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1461,7 +1461,7 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
 	}
 
 	__skb_queue_head_init(&pkts);
-	mtu = tipc_node_get_mtu(net, dnode, tsk->portid, false);
+	mtu = tipc_node_get_mtu(net, dnode, tsk->portid, true);
 	rc = tipc_msg_build(hdr, m, 0, dlen, mtu, &pkts);
 	if (unlikely(rc != dlen))
 		return rc;
-- 
2.20.1


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

* Re: [net-next] tipc: Add a missing case of TIPC_DIRECT_MSG type
  2020-03-26  2:50 [net-next] tipc: Add a missing case of TIPC_DIRECT_MSG type Hoang Le
@ 2020-03-26 18:21 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-03-26 18:21 UTC (permalink / raw)
  To: hoang.h.le; +Cc: netdev, ying.xue, maloy, jmaloy, tuong.t.lien

From: Hoang Le <hoang.h.le@dektech.com.au>
Date: Thu, 26 Mar 2020 09:50:29 +0700

> In the commit f73b12812a3d
> ("tipc: improve throughput between nodes in netns"), we're missing a check
> to handle TIPC_DIRECT_MSG type, it's still using old sending mechanism for
> this message type. So, throughput improvement is not significant as
> expected.
> 
> Besides that, when sending a large message with that type, we're also
> handle wrong receiving queue, it should be enqueued in socket receiving
> instead of multicast messages.
> 
> Fix this by adding the missing case for TIPC_DIRECT_MSG.
> 
> Fixes: f73b12812a3d ("tipc: improve throughput between nodes in netns")
> Reported-by: Tuong Lien <tuong.t.lien@dektech.com.au>
> Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
> Acked-by: Jon Maloy <jmaloy@redhat.com>

Applied to net-next, thank you.

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

end of thread, other threads:[~2020-03-26 18:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26  2:50 [net-next] tipc: Add a missing case of TIPC_DIRECT_MSG type Hoang Le
2020-03-26 18:21 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.