aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-07-16 16:54:24 -0400
committerDavid S. Miller <davem@davemloft.net>2015-07-20 23:41:15 -0400
commitaf9b028e270fda6fb812d70d17d902297df1ceb5 (patch)
tree1a204c6d10d597d5db18908dc2066e980a78120d /net/tipc/socket.c
parent22d85c79428b8ca9a01623aa3e3a1fe29a30a119 (diff)
tipc: make media xmit call outside node spinlock context
Currently, message sending is performed through a deep call chain, where the node spinlock is grabbed and held during a significant part of the transmission time. This is clearly detrimental to overall throughput performance; it would be better if we could send the message after the spinlock has been released. In this commit, we do instead let the call revert on the stack after the buffer chain has been added to the transmission queue, whereafter clones of the buffers are transmitted to the device layer outside the spinlock scope. As a further step in our effort to separate the roles of the node and link entities we also move the function tipc_link_xmit() to node.c, and rename it to tipc_node_xmit(). Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r--net/tipc/socket.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 87fef25f6519..5b0b08d58fcc 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -261,7 +261,7 @@ static void tsk_rej_rx_queue(struct sock *sk)
261 261
262 while ((skb = __skb_dequeue(&sk->sk_receive_queue))) { 262 while ((skb = __skb_dequeue(&sk->sk_receive_queue))) {
263 if (tipc_msg_reverse(own_node, skb, &dnode, TIPC_ERR_NO_PORT)) 263 if (tipc_msg_reverse(own_node, skb, &dnode, TIPC_ERR_NO_PORT))
264 tipc_link_xmit_skb(sock_net(sk), skb, dnode, 0); 264 tipc_node_xmit_skb(sock_net(sk), skb, dnode, 0);
265 } 265 }
266} 266}
267 267
@@ -443,7 +443,7 @@ static int tipc_release(struct socket *sock)
443 } 443 }
444 if (tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, 444 if (tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode,
445 TIPC_ERR_NO_PORT)) 445 TIPC_ERR_NO_PORT))
446 tipc_link_xmit_skb(net, skb, dnode, 0); 446 tipc_node_xmit_skb(net, skb, dnode, 0);
447 } 447 }
448 } 448 }
449 449
@@ -456,7 +456,7 @@ static int tipc_release(struct socket *sock)
456 tsk_own_node(tsk), tsk_peer_port(tsk), 456 tsk_own_node(tsk), tsk_peer_port(tsk),
457 tsk->portid, TIPC_ERR_NO_PORT); 457 tsk->portid, TIPC_ERR_NO_PORT);
458 if (skb) 458 if (skb)
459 tipc_link_xmit_skb(net, skb, dnode, tsk->portid); 459 tipc_node_xmit_skb(net, skb, dnode, tsk->portid);
460 tipc_node_remove_conn(net, dnode, tsk->portid); 460 tipc_node_remove_conn(net, dnode, tsk->portid);
461 } 461 }
462 462
@@ -925,7 +925,7 @@ new_mtu:
925 do { 925 do {
926 skb = skb_peek(pktchain); 926 skb = skb_peek(pktchain);
927 TIPC_SKB_CB(skb)->wakeup_pending = tsk->link_cong; 927 TIPC_SKB_CB(skb)->wakeup_pending = tsk->link_cong;
928 rc = tipc_link_xmit(net, pktchain, dnode, tsk->portid); 928 rc = tipc_node_xmit(net, pktchain, dnode, tsk->portid);
929 if (likely(!rc)) { 929 if (likely(!rc)) {
930 if (sock->state != SS_READY) 930 if (sock->state != SS_READY)
931 sock->state = SS_CONNECTING; 931 sock->state = SS_CONNECTING;
@@ -1045,7 +1045,7 @@ next:
1045 return rc; 1045 return rc;
1046 do { 1046 do {
1047 if (likely(!tsk_conn_cong(tsk))) { 1047 if (likely(!tsk_conn_cong(tsk))) {
1048 rc = tipc_link_xmit(net, pktchain, dnode, portid); 1048 rc = tipc_node_xmit(net, pktchain, dnode, portid);
1049 if (likely(!rc)) { 1049 if (likely(!rc)) {
1050 tsk->sent_unacked++; 1050 tsk->sent_unacked++;
1051 sent += send; 1051 sent += send;
@@ -1224,7 +1224,7 @@ static void tipc_sk_send_ack(struct tipc_sock *tsk, uint ack)
1224 return; 1224 return;
1225 msg = buf_msg(skb); 1225 msg = buf_msg(skb);
1226 msg_set_msgcnt(msg, ack); 1226 msg_set_msgcnt(msg, ack);
1227 tipc_link_xmit_skb(net, skb, dnode, msg_link_selector(msg)); 1227 tipc_node_xmit_skb(net, skb, dnode, msg_link_selector(msg));
1228} 1228}
1229 1229
1230static int tipc_wait_for_rcvmsg(struct socket *sock, long *timeop) 1230static int tipc_wait_for_rcvmsg(struct socket *sock, long *timeop)
@@ -1703,7 +1703,7 @@ static int tipc_backlog_rcv(struct sock *sk, struct sk_buff *skb)
1703 return 0; 1703 return 0;
1704 } 1704 }
1705 if (!err || tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, -err)) 1705 if (!err || tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, -err))
1706 tipc_link_xmit_skb(net, skb, dnode, tsk->portid); 1706 tipc_node_xmit_skb(net, skb, dnode, tsk->portid);
1707 return 0; 1707 return 0;
1708} 1708}
1709 1709
@@ -1799,7 +1799,7 @@ int tipc_sk_rcv(struct net *net, struct sk_buff_head *inputq)
1799 if (!tipc_msg_reverse(tn->own_addr, skb, &dnode, -err)) 1799 if (!tipc_msg_reverse(tn->own_addr, skb, &dnode, -err))
1800 continue; 1800 continue;
1801xmit: 1801xmit:
1802 tipc_link_xmit_skb(net, skb, dnode, dport); 1802 tipc_node_xmit_skb(net, skb, dnode, dport);
1803 } 1803 }
1804 return err ? -EHOSTUNREACH : 0; 1804 return err ? -EHOSTUNREACH : 0;
1805} 1805}
@@ -2092,7 +2092,7 @@ restart:
2092 } 2092 }
2093 if (tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, 2093 if (tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode,
2094 TIPC_CONN_SHUTDOWN)) 2094 TIPC_CONN_SHUTDOWN))
2095 tipc_link_xmit_skb(net, skb, dnode, 2095 tipc_node_xmit_skb(net, skb, dnode,
2096 tsk->portid); 2096 tsk->portid);
2097 } else { 2097 } else {
2098 dnode = tsk_peer_node(tsk); 2098 dnode = tsk_peer_node(tsk);
@@ -2102,7 +2102,7 @@ restart:
2102 0, dnode, tsk_own_node(tsk), 2102 0, dnode, tsk_own_node(tsk),
2103 tsk_peer_port(tsk), 2103 tsk_peer_port(tsk),
2104 tsk->portid, TIPC_CONN_SHUTDOWN); 2104 tsk->portid, TIPC_CONN_SHUTDOWN);
2105 tipc_link_xmit_skb(net, skb, dnode, tsk->portid); 2105 tipc_node_xmit_skb(net, skb, dnode, tsk->portid);
2106 } 2106 }
2107 tsk->connected = 0; 2107 tsk->connected = 0;
2108 sock->state = SS_DISCONNECTING; 2108 sock->state = SS_DISCONNECTING;
@@ -2164,7 +2164,7 @@ static void tipc_sk_timeout(unsigned long data)
2164 } 2164 }
2165 bh_unlock_sock(sk); 2165 bh_unlock_sock(sk);
2166 if (skb) 2166 if (skb)
2167 tipc_link_xmit_skb(sock_net(sk), skb, peer_node, tsk->portid); 2167 tipc_node_xmit_skb(sock_net(sk), skb, peer_node, tsk->portid);
2168exit: 2168exit:
2169 sock_put(sk); 2169 sock_put(sk);
2170} 2170}