summaryrefslogtreecommitdiffstats
path: root/net/tipc/bearer.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/bearer.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/bearer.c')
-rw-r--r--net/tipc/bearer.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 00bc0e620532..eae58a6b121c 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -470,6 +470,32 @@ void tipc_bearer_send(struct net *net, u32 bearer_id, struct sk_buff *buf,
470 rcu_read_unlock(); 470 rcu_read_unlock();
471} 471}
472 472
473/* tipc_bearer_xmit() -send buffer to destination over bearer
474 */
475void tipc_bearer_xmit(struct net *net, u32 bearer_id,
476 struct sk_buff_head *xmitq,
477 struct tipc_media_addr *dst)
478{
479 struct tipc_net *tn = net_generic(net, tipc_net_id);
480 struct tipc_bearer *b;
481 struct sk_buff *skb, *tmp;
482
483 if (skb_queue_empty(xmitq))
484 return;
485
486 rcu_read_lock();
487 b = rcu_dereference_rtnl(tn->bearer_list[bearer_id]);
488 if (likely(b)) {
489 skb_queue_walk_safe(xmitq, skb, tmp) {
490 __skb_dequeue(xmitq);
491 b->media->send_msg(net, skb, b, dst);
492 /* Until we remove cloning in tipc_l2_send_msg(): */
493 kfree_skb(skb);
494 }
495 }
496 rcu_read_unlock();
497}
498
473/** 499/**
474 * tipc_l2_rcv_msg - handle incoming TIPC message from an interface 500 * tipc_l2_rcv_msg - handle incoming TIPC message from an interface
475 * @buf: the received packet 501 * @buf: the received packet