tipc: set default MTU for UDP media
authorGhantaKrishnamurthy MohanKrishna <mohan.krishna.ghanta.krishnamurthy@ericsson.com>
Thu, 19 Apr 2018 09:06:18 +0000 (11:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Apr 2018 15:04:05 +0000 (11:04 -0400)
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>
include/uapi/linux/tipc_config.h
net/tipc/udp_media.c

index 3f29e3c8ed0668fd22dd674e6e7654fdb6ea6a45..4b2c93b1934cf570a3dc7fae7499bd1f23a59703 100644 (file)
 #define TIPC_DEF_LINK_WIN 50
 #define TIPC_MAX_LINK_WIN 8191
 
+/*
+ * Default MTU for UDP media
+ */
+
+#define TIPC_DEF_LINK_UDP_MTU 14000
 
 struct tipc_node_info {
        __be32 addr;                    /* network address of node */
index e7d91f5d5caed6f19f198ba91a24af9bf8ee51c2..9783101bc4a9ad5fb80cc014490bfa3da5ed1c8b 100644 (file)
@@ -713,8 +713,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
                        err = -EINVAL;
                        goto err;
                }
-               b->mtu = dev->mtu - sizeof(struct iphdr)
-                       - sizeof(struct udphdr);
+               b->mtu = b->media->mtu;
 #if IS_ENABLED(CONFIG_IPV6)
        } else if (local.proto == htons(ETH_P_IPV6)) {
                udp_conf.family = AF_INET6;
@@ -803,6 +802,7 @@ struct tipc_media udp_media_info = {
        .priority       = TIPC_DEF_LINK_PRI,
        .tolerance      = TIPC_DEF_LINK_TOL,
        .window         = TIPC_DEF_LINK_WIN,
+       .mtu            = TIPC_DEF_LINK_UDP_MTU,
        .type_id        = TIPC_MEDIA_TYPE_UDP,
        .hwaddr_len     = 0,
        .name           = "udp"