aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGhantaKrishnamurthy MohanKrishna <mohan.krishna.ghanta.krishnamurthy@ericsson.com>2018-04-19 05:06:18 -0400
committerDavid S. Miller <davem@davemloft.net>2018-04-20 11:04:05 -0400
commita4dfa72d0acd1c99a160e25c099849ae37ad13fd (patch)
tree675821e7e385b24adb94d998284dddf35b498380
parentcea395ac868dee9104aa4fff640486cf4b3c464c (diff)
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>
-rw-r--r--include/uapi/linux/tipc_config.h5
-rw-r--r--net/tipc/udp_media.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/include/uapi/linux/tipc_config.h b/include/uapi/linux/tipc_config.h
index 3f29e3c8ed06..4b2c93b1934c 100644
--- a/include/uapi/linux/tipc_config.h
+++ b/include/uapi/linux/tipc_config.h
@@ -185,6 +185,11 @@
185#define TIPC_DEF_LINK_WIN 50 185#define TIPC_DEF_LINK_WIN 50
186#define TIPC_MAX_LINK_WIN 8191 186#define TIPC_MAX_LINK_WIN 8191
187 187
188/*
189 * Default MTU for UDP media
190 */
191
192#define TIPC_DEF_LINK_UDP_MTU 14000
188 193
189struct tipc_node_info { 194struct tipc_node_info {
190 __be32 addr; /* network address of node */ 195 __be32 addr; /* network address of node */
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c
index e7d91f5d5cae..9783101bc4a9 100644
--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -713,8 +713,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
713 err = -EINVAL; 713 err = -EINVAL;
714 goto err; 714 goto err;
715 } 715 }
716 b->mtu = dev->mtu - sizeof(struct iphdr) 716 b->mtu = b->media->mtu;
717 - sizeof(struct udphdr);
718#if IS_ENABLED(CONFIG_IPV6) 717#if IS_ENABLED(CONFIG_IPV6)
719 } else if (local.proto == htons(ETH_P_IPV6)) { 718 } else if (local.proto == htons(ETH_P_IPV6)) {
720 udp_conf.family = AF_INET6; 719 udp_conf.family = AF_INET6;
@@ -803,6 +802,7 @@ struct tipc_media udp_media_info = {
803 .priority = TIPC_DEF_LINK_PRI, 802 .priority = TIPC_DEF_LINK_PRI,
804 .tolerance = TIPC_DEF_LINK_TOL, 803 .tolerance = TIPC_DEF_LINK_TOL,
805 .window = TIPC_DEF_LINK_WIN, 804 .window = TIPC_DEF_LINK_WIN,
805 .mtu = TIPC_DEF_LINK_UDP_MTU,
806 .type_id = TIPC_MEDIA_TYPE_UDP, 806 .type_id = TIPC_MEDIA_TYPE_UDP,
807 .hwaddr_len = 0, 807 .hwaddr_len = 0,
808 .name = "udp" 808 .name = "udp"