]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fall back to smaller MTU if allocation of local send skb fails
authorJon Maloy <jon.maloy@ericsson.com>
Thu, 30 Nov 2017 15:47:25 +0000 (16:47 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Dec 2017 20:21:25 +0000 (15:21 -0500)
commita6230aba4259f57ca0f0651b48fb90d18a62bea7
tree5a45310f3e6802cd7bc958806ea770c23cab66d5
parent8b20dc35c0d9a08b5833a1857ecf451a05de8681
tipc: fall back to smaller MTU if allocation of local send skb fails

When sending node local messages the code is using an 'mtu' of 66060
bytes to avoid unnecessary fragmentation. During situations of low
memory tipc_msg_build() may sometimes fail to allocate such large
buffers, resulting in unnecessary send failures. This can easily be
remedied by falling back to a smaller MTU, and then reassemble the
buffer chain as if the message were arriving from a remote node.

At the same time, we change the initial MTU setting of the broadcast
link to a lower value, so that large messages always are fragmented
into smaller buffers even when we run in single node mode. Apart from
obtaining the same advantage as for the 'fallback' solution above, this
turns out to give a significant performance improvement. This can
probably be explained with the __pskb_copy() operation performed on the
buffer for each recipient during reception. We found the optimal value
for this, considering the most relevant skb pool, to be 3744 bytes.

Acked-by: Ying Xue <ying.xue@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/bcast.c
net/tipc/link.c
net/tipc/msg.c
net/tipc/msg.h