diff options
author | GhantaKrishnamurthy MohanKrishna <mohan.krishna.ghanta.krishnamurthy@ericsson.com> | 2018-04-19 05:06:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-20 11:04:05 -0400 |
commit | 901271e0403af638c224987c2a4e55cebade7e91 (patch) | |
tree | c1d76383cebfd75ca87fb49ef212ee9c90f174e0 /net/tipc/bearer.c | |
parent | a4dfa72d0acd1c99a160e25c099849ae37ad13fd (diff) |
tipc: implement configuration of UDP media MTU
In previous commit, we changed the default emulated MTU for UDP bearers
to 14k.
This commit adds the functionality to set/change the default value
by configuring new MTU for UDP media. UDP bearer(s) have to be disabled
and enabled back for the new MTU to take effect.
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>
Diffstat (limited to 'net/tipc/bearer.c')
-rw-r--r-- | net/tipc/bearer.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index f7d47c89d658..a22caf9e5a18 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
@@ -1029,6 +1029,9 @@ static int __tipc_nl_add_media(struct tipc_nl_msg *msg, | |||
1029 | goto prop_msg_full; | 1029 | goto prop_msg_full; |
1030 | if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, media->window)) | 1030 | if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, media->window)) |
1031 | goto prop_msg_full; | 1031 | goto prop_msg_full; |
1032 | if (media->type_id == TIPC_MEDIA_TYPE_UDP) | ||
1033 | if (nla_put_u32(msg->skb, TIPC_NLA_PROP_MTU, media->mtu)) | ||
1034 | goto prop_msg_full; | ||
1032 | 1035 | ||
1033 | nla_nest_end(msg->skb, prop); | 1036 | nla_nest_end(msg->skb, prop); |
1034 | nla_nest_end(msg->skb, attrs); | 1037 | nla_nest_end(msg->skb, attrs); |
@@ -1158,6 +1161,16 @@ int __tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info) | |||
1158 | m->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); | 1161 | m->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); |
1159 | if (props[TIPC_NLA_PROP_WIN]) | 1162 | if (props[TIPC_NLA_PROP_WIN]) |
1160 | m->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]); | 1163 | m->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]); |
1164 | if (props[TIPC_NLA_PROP_MTU]) { | ||
1165 | if (m->type_id != TIPC_MEDIA_TYPE_UDP) | ||
1166 | return -EINVAL; | ||
1167 | #ifdef CONFIG_TIPC_MEDIA_UDP | ||
1168 | if (tipc_udp_mtu_bad(nla_get_u32 | ||
1169 | (props[TIPC_NLA_PROP_MTU]))) | ||
1170 | return -EINVAL; | ||
1171 | m->mtu = nla_get_u32(props[TIPC_NLA_PROP_MTU]); | ||
1172 | #endif | ||
1173 | } | ||
1161 | } | 1174 | } |
1162 | 1175 | ||
1163 | return 0; | 1176 | return 0; |