Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4dfa72d authored by GhantaKrishnamurthy MohanKrishna's avatar GhantaKrishnamurthy MohanKrishna Committed by David S. Miller
Browse files

tipc: set default MTU for UDP media



Currently, all bearers are configured with MTU value same as the
underlying L2 device. However, in case of bearers with media type
UDP, higher throughput is possible with a fixed and higher emulated
MTU value than adapting to the underlying L2 MTU.

In this commit, we introduce a parameter mtu in struct tipc_media
and a default value is set for UDP. A default value of 14k
was determined by experimentation and found to have a higher throughput
than 16k. MTU for UDP bearers are assigned the above set value of
media MTU.

Acked-by: default avatarYing Xue <ying.xue@windriver.com>
Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarGhantaKrishnamurthy MohanKrishna <mohan.krishna.ghanta.krishnamurthy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cea395ac
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -185,6 +185,11 @@
#define TIPC_DEF_LINK_WIN 50
#define TIPC_DEF_LINK_WIN 50
#define TIPC_MAX_LINK_WIN 8191
#define TIPC_MAX_LINK_WIN 8191


/*
 * Default MTU for UDP media
 */

#define TIPC_DEF_LINK_UDP_MTU 14000


struct tipc_node_info {
struct tipc_node_info {
	__be32 addr;			/* network address of node */
	__be32 addr;			/* network address of node */
+2 −2
Original line number Original line Diff line number Diff line
@@ -713,8 +713,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
			err = -EINVAL;
			err = -EINVAL;
			goto err;
			goto err;
		}
		}
		b->mtu = dev->mtu - sizeof(struct iphdr)
		b->mtu = b->media->mtu;
			- sizeof(struct udphdr);
#if IS_ENABLED(CONFIG_IPV6)
#if IS_ENABLED(CONFIG_IPV6)
	} else if (local.proto == htons(ETH_P_IPV6)) {
	} else if (local.proto == htons(ETH_P_IPV6)) {
		udp_conf.family = AF_INET6;
		udp_conf.family = AF_INET6;
@@ -803,6 +802,7 @@ struct tipc_media udp_media_info = {
	.priority	= TIPC_DEF_LINK_PRI,
	.priority	= TIPC_DEF_LINK_PRI,
	.tolerance	= TIPC_DEF_LINK_TOL,
	.tolerance	= TIPC_DEF_LINK_TOL,
	.window		= TIPC_DEF_LINK_WIN,
	.window		= TIPC_DEF_LINK_WIN,
	.mtu		= TIPC_DEF_LINK_UDP_MTU,
	.type_id	= TIPC_MEDIA_TYPE_UDP,
	.type_id	= TIPC_MEDIA_TYPE_UDP,
	.hwaddr_len	= 0,
	.hwaddr_len	= 0,
	.name		= "udp"
	.name		= "udp"