Commit 8b1e5b0a authored by Hoang Le's avatar Hoang Le Committed by David S. Miller

tipc: Add a missing case of TIPC_DIRECT_MSG type

In the commit f73b1281
("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: f73b1281 ("tipc: improve throughput between nodes in netns")
Reported-by: default avatarTuong Lien <tuong.t.lien@dektech.com.au>
Signed-off-by: default avatarHoang Le <hoang.h.le@dektech.com.au>
Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9fb16955
...@@ -394,6 +394,11 @@ static inline u32 msg_connected(struct tipc_msg *m) ...@@ -394,6 +394,11 @@ static inline u32 msg_connected(struct tipc_msg *m)
return msg_type(m) == TIPC_CONN_MSG; 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) static inline u32 msg_errcode(struct tipc_msg *m)
{ {
return msg_bits(m, 1, 25, 0xf); return msg_bits(m, 1, 25, 0xf);
......
...@@ -1586,7 +1586,8 @@ static void tipc_lxc_xmit(struct net *peer_net, struct sk_buff_head *list) ...@@ -1586,7 +1586,8 @@ static void tipc_lxc_xmit(struct net *peer_net, struct sk_buff_head *list)
case TIPC_MEDIUM_IMPORTANCE: case TIPC_MEDIUM_IMPORTANCE:
case TIPC_HIGH_IMPORTANCE: case TIPC_HIGH_IMPORTANCE:
case TIPC_CRITICAL_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); tipc_loopback_trace(peer_net, list);
spin_lock_init(&list->lock); spin_lock_init(&list->lock);
tipc_sk_rcv(peer_net, list); tipc_sk_rcv(peer_net, list);
......
...@@ -1461,7 +1461,7 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen) ...@@ -1461,7 +1461,7 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
} }
__skb_queue_head_init(&pkts); __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); rc = tipc_msg_build(hdr, m, 0, dlen, mtu, &pkts);
if (unlikely(rc != dlen)) if (unlikely(rc != dlen))
return rc; return rc;
......
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