summaryrefslogtreecommitdiffstats
path: root/net/tipc/bearer.c
diff options
context:
space:
mode:
authorGhantaKrishnamurthy MohanKrishna <mohan.krishna.ghanta.krishnamurthy@ericsson.com>2018-04-19 05:06:20 -0400
committerDavid S. Miller <davem@davemloft.net>2018-04-20 11:04:05 -0400
commit682cd3cf946b66bace4aa1037f49f0093ff182ce (patch)
tree4c52280069d825436b0658c9a43d43c1cca80d2c /net/tipc/bearer.c
parent901271e0403af638c224987c2a4e55cebade7e91 (diff)
tipc: confgiure and apply UDP bearer MTU on running links
Currently, we have option to configure MTU of UDP media. The configured MTU takes effect on the links going up after that moment. I.e, a user has to reset bearer to have new value applied across its links. This is confusing and disturbing on a running cluster. We now introduce the functionality to change the default UDP bearer MTU in struct tipc_bearer. Additionally, the links are updated dynamically, without any need for a reset, when bearer value is changed. We leverage the existing per-link functionality and the design being symetrical to the confguration of link tolerance. 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>
Diffstat (limited to 'net/tipc/bearer.c')
-rw-r--r--net/tipc/bearer.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index a22caf9e5a18..2dfb492a7c94 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -697,6 +697,9 @@ static int __tipc_nl_add_bearer(struct tipc_nl_msg *msg,
697 goto prop_msg_full; 697 goto prop_msg_full;
698 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, bearer->window)) 698 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, bearer->window))
699 goto prop_msg_full; 699 goto prop_msg_full;
700 if (bearer->media->type_id == TIPC_MEDIA_TYPE_UDP)
701 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_MTU, bearer->mtu))
702 goto prop_msg_full;
700 703
701 nla_nest_end(msg->skb, prop); 704 nla_nest_end(msg->skb, prop);
702 705
@@ -979,12 +982,23 @@ int __tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info)
979 982
980 if (props[TIPC_NLA_PROP_TOL]) { 983 if (props[TIPC_NLA_PROP_TOL]) {
981 b->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]); 984 b->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]);
982 tipc_node_apply_tolerance(net, b); 985 tipc_node_apply_property(net, b, TIPC_NLA_PROP_TOL);
983 } 986 }
984 if (props[TIPC_NLA_PROP_PRIO]) 987 if (props[TIPC_NLA_PROP_PRIO])
985 b->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); 988 b->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]);
986 if (props[TIPC_NLA_PROP_WIN]) 989 if (props[TIPC_NLA_PROP_WIN])
987 b->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]); 990 b->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]);
991 if (props[TIPC_NLA_PROP_MTU]) {
992 if (b->media->type_id != TIPC_MEDIA_TYPE_UDP)
993 return -EINVAL;
994#ifdef CONFIG_TIPC_MEDIA_UDP
995 if (tipc_udp_mtu_bad(nla_get_u32
996 (props[TIPC_NLA_PROP_MTU])))
997 return -EINVAL;
998 b->mtu = nla_get_u32(props[TIPC_NLA_PROP_MTU]);
999 tipc_node_apply_property(net, b, TIPC_NLA_PROP_MTU);
1000#endif
1001 }
988 } 1002 }
989 1003
990 return 0; 1004 return 0;