Skip to content

Commit a4dfa72

Browse files
GhantaKrishnamurthy MohanKrishnadavem330
authored andcommitted
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: Ying Xue <ying.xue@windriver.com> Acked-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: GhantaKrishnamurthy MohanKrishna <mohan.krishna.ghanta.krishnamurthy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent cea395a commit a4dfa72

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

include/uapi/linux/tipc_config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@
185185
#define TIPC_DEF_LINK_WIN 50
186186
#define TIPC_MAX_LINK_WIN 8191
187187

188+
/*
189+
* Default MTU for UDP media
190+
*/
191+
192+
#define TIPC_DEF_LINK_UDP_MTU 14000
188193

189194
struct tipc_node_info {
190195
__be32 addr; /* network address of node */

net/tipc/udp_media.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
713713
err = -EINVAL;
714714
goto err;
715715
}
716-
b->mtu = dev->mtu - sizeof(struct iphdr)
717-
- sizeof(struct udphdr);
716+
b->mtu = b->media->mtu;
718717
#if IS_ENABLED(CONFIG_IPV6)
719718
} else if (local.proto == htons(ETH_P_IPV6)) {
720719
udp_conf.family = AF_INET6;
@@ -803,6 +802,7 @@ struct tipc_media udp_media_info = {
803802
.priority = TIPC_DEF_LINK_PRI,
804803
.tolerance = TIPC_DEF_LINK_TOL,
805804
.window = TIPC_DEF_LINK_WIN,
805+
.mtu = TIPC_DEF_LINK_UDP_MTU,
806806
.type_id = TIPC_MEDIA_TYPE_UDP,
807807
.hwaddr_len = 0,
808808
.name = "udp"

0 commit comments

Comments
 (0)