aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2017-10-13 05:04:21 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-13 11:46:00 -0400
commitf70d37b796241f617107d5585ee96a7e1b660b63 (patch)
tree3f23524fa7b31c7205d0c7f1f49cfd6ff027d5b6 /net/tipc/socket.c
parent64ac5f5977df5b276374fb2f051082129f5cdb22 (diff)
tipc: add new function for sending multiple small messages
We see an increasing need to send multiple single-buffer messages of TIPC_SYSTEM_IMPORTANCE to different individual destination nodes. Instead of looping over the send queue and sending each buffer individually, as we do now, we add a new help function tipc_node_distr_xmit() to do this. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r--net/tipc/socket.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index bc226f5a1be3..c7c674934474 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1740,14 +1740,11 @@ static void tipc_sk_filter_rcv(struct sock *sk, struct sk_buff *skb,
1740 * @skb: message 1740 * @skb: message
1741 * 1741 *
1742 * Caller must hold socket lock 1742 * Caller must hold socket lock
1743 *
1744 * Returns 0
1745 */ 1743 */
1746static int tipc_sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) 1744static int tipc_sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
1747{ 1745{
1748 unsigned int before = sk_rmem_alloc_get(sk); 1746 unsigned int before = sk_rmem_alloc_get(sk);
1749 struct sk_buff_head xmitq; 1747 struct sk_buff_head xmitq;
1750 u32 dnode, selector;
1751 unsigned int added; 1748 unsigned int added;
1752 1749
1753 __skb_queue_head_init(&xmitq); 1750 __skb_queue_head_init(&xmitq);
@@ -1757,11 +1754,7 @@ static int tipc_sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
1757 atomic_add(added, &tipc_sk(sk)->dupl_rcvcnt); 1754 atomic_add(added, &tipc_sk(sk)->dupl_rcvcnt);
1758 1755
1759 /* Send pending response/rejected messages, if any */ 1756 /* Send pending response/rejected messages, if any */
1760 while ((skb = __skb_dequeue(&xmitq))) { 1757 tipc_node_distr_xmit(sock_net(sk), &xmitq);
1761 selector = msg_origport(buf_msg(skb));
1762 dnode = msg_destnode(buf_msg(skb));
1763 tipc_node_xmit_skb(sock_net(sk), skb, dnode, selector);
1764 }
1765 return 0; 1758 return 0;
1766} 1759}
1767 1760
@@ -1840,10 +1833,7 @@ void tipc_sk_rcv(struct net *net, struct sk_buff_head *inputq)
1840 spin_unlock_bh(&sk->sk_lock.slock); 1833 spin_unlock_bh(&sk->sk_lock.slock);
1841 } 1834 }
1842 /* Send pending response/rejected messages, if any */ 1835 /* Send pending response/rejected messages, if any */
1843 while ((skb = __skb_dequeue(&xmitq))) { 1836 tipc_node_distr_xmit(sock_net(sk), &xmitq);
1844 dnode = msg_destnode(buf_msg(skb));
1845 tipc_node_xmit_skb(net, skb, dnode, dport);
1846 }
1847 sock_put(sk); 1837 sock_put(sk);
1848 continue; 1838 continue;
1849 } 1839 }