From patchwork Thu Apr 19 09:06:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: GhantaKrishnamurthy MohanKrishna X-Patchwork-Id: 900709 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ericsson.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ericsson.com header.i=@ericsson.com header.b="hcNYv12a"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40RY5C00yrz9s2M for ; Thu, 19 Apr 2018 19:06:38 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751136AbeDSJGg (ORCPT ); Thu, 19 Apr 2018 05:06:36 -0400 Received: from sessmg22.ericsson.net ([193.180.251.58]:45980 "EHLO sessmg22.ericsson.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750799AbeDSJGd (ORCPT ); Thu, 19 Apr 2018 05:06:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1524128793; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=s/tQRNB7p2yOAc6yyTtzFB/9zQKkMZZeeRoe9QObT0k=; b=hcNYv12aS80Q2sYVPNCbhrUYNTbYVBMyrsA8oZxD+vxOsD2+gWzb/cWJO5B0bbOs rdchJEmCaZRIenfdWBDLHGew0/uPESjSWRc4Ardv6vGDsFZdToDdUdiOWXreXfC5 9rXosAUDgDQR2AJeEJQG8k8ZwQx2bVtvuBQfQxS5RkA=; X-AuditID: c1b4fb3a-eae319c00000795a-31-5ad85c1807c9 Received: from ESESSHC011.ericsson.se (Unknown_Domain [153.88.183.51]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id 8C.A0.31066.81C58DA5; Thu, 19 Apr 2018 11:06:33 +0200 (CEST) Received: from daly.lab.linux.ericsson.se (10.35.28.123) by ESESSHC011.ericsson.se (153.88.183.51) with Microsoft SMTP Server (TLS) id 14.3.382.0; Thu, 19 Apr 2018 11:06:30 +0200 From: GhantaKrishnamurthy MohanKrishna To: , , , , , , Subject: [net-next 1/3] tipc: set default MTU for UDP media Date: Thu, 19 Apr 2018 11:06:18 +0200 Message-ID: <1524128780-2550-2-git-send-email-mohan.krishna.ghanta.krishnamurthy@ericsson.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1524128780-2550-1-git-send-email-mohan.krishna.ghanta.krishnamurthy@ericsson.com> References: <1524128780-2550-1-git-send-email-mohan.krishna.ghanta.krishnamurthy@ericsson.com> MIME-Version: 1.0 X-Originating-IP: [10.35.28.123] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBLMWRmVeSWpSXmKPExsUyM2K7sa5kzI0og6b3jBZzzrewWCxadJjJ 4tgCMYst57MsHl+/zuzA6rFl5U0mj/c9V5g8di/4zOTxeZOcx/otW5kCWKO4bFJSczLLUov0 7RK4Ml7uWcNSsFOg4m3vKvYGxt28XYycHBICJhKflhxj6mLk4hASOMIocXjSHhYIZxujRPuB L6wgVWwCURI7DmxkB0mICNxjlOi4MJcRJCEsYCOxpeE+M4jNIqAq0brzOBOIzSsQJ9Fx8icr xAo5ifPHf4LVcArES6zYfYAFxBYCqvm5/BQrRL2gxMmZT8DizAISEgdfvACq5wCqsZG4t94F YoyCxIdZy9gmMPLPQtIxC0nHAkamVYyixanFxbnpRkZ6qUWZycXF+Xl6eaklmxiB4Xlwy2+r HYwHnzseYhTgYFTi4a0OvRElxJpYVlyZe4hRgoNZSYRX/Oz1KCHelMTKqtSi/Pii0pzU4kOM 0hwsSuK8TmkWUUIC6YklqdmpqQWpRTBZJg5OqQZGo4Q3y191NEWrz3u85VPaEimBvTPjyxIe t7Vui3+yY2WiwTQW0SNn5W+U6TL7F9759uBHbdKbhtzy3HBFlck3z/sYrsm2nBas+7pM4mzn 3xrH4C1bPi3Q8xeU/GO/IVxrt2GqcoBe/7G5l9Y8X6Kt++N5y7v3v1fvmFx5TPC80NQfH68f afCOUGIpzkg01GIuKk4EAJ+SOl1LAgAA Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Acked-by: Jon Maloy Signed-off-by: GhantaKrishnamurthy MohanKrishna --- include/uapi/linux/tipc_config.h | 5 +++++ net/tipc/udp_media.c | 4 ++-- 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 @@ #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 */ 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, 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" From patchwork Thu Apr 19 09:06:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: GhantaKrishnamurthy MohanKrishna X-Patchwork-Id: 900710 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ericsson.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ericsson.com header.i=@ericsson.com header.b="JJJgHqlj"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40RY5G1WQxz9s2B for ; Thu, 19 Apr 2018 19:06:42 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751194AbeDSJGk (ORCPT ); Thu, 19 Apr 2018 05:06:40 -0400 Received: from sesbmg22.ericsson.net ([193.180.251.48]:46002 "EHLO sesbmg22.ericsson.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750799AbeDSJGh (ORCPT ); Thu, 19 Apr 2018 05:06:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1524128795; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3WUn/MxK79u2Lcr0RpCpWDaCQmM9qn4oIP1KS0NdZRY=; b=JJJgHqlj+nUhfKgXKGsWBzlBOwexsPppfndURsrYXZhFyCLD6T5ufr+0YpNFlAul Tx56fM8y0WwqlgXNRfFPpr2ODBbT9qD3OwZSN/1PCbSDiY0QVSfTpyrd4es+HTg1 fQbefIeYcg7LnPKpUaZ8f8M4dYdOutAa/MZ1Gdjlc8Q=; X-AuditID: c1b4fb30-4c8039c000007681-3c-5ad85c1b8ca9 Received: from ESESSHC011.ericsson.se (Unknown_Domain [153.88.183.51]) by sesbmg22.ericsson.net (Symantec Mail Security) with SMTP id 52.CF.30337.B1C58DA5; Thu, 19 Apr 2018 11:06:35 +0200 (CEST) Received: from daly.lab.linux.ericsson.se (10.35.28.123) by ESESSHC011.ericsson.se (153.88.183.51) with Microsoft SMTP Server (TLS) id 14.3.382.0; Thu, 19 Apr 2018 11:06:32 +0200 From: GhantaKrishnamurthy MohanKrishna To: , , , , , , Subject: [net-next 2/3] tipc: implement configuration of UDP media MTU Date: Thu, 19 Apr 2018 11:06:19 +0200 Message-ID: <1524128780-2550-3-git-send-email-mohan.krishna.ghanta.krishnamurthy@ericsson.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1524128780-2550-1-git-send-email-mohan.krishna.ghanta.krishnamurthy@ericsson.com> References: <1524128780-2550-1-git-send-email-mohan.krishna.ghanta.krishnamurthy@ericsson.com> MIME-Version: 1.0 X-Originating-IP: [10.35.28.123] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGLMWRmVeSWpSXmKPExsUyM2K7sa50zI0og4WTVCzmnG9hsVi06DCT xbEFYhZbzmdZPL5+ndmB1WPLyptMHu97rjB57F7wmcnj8yY5j/VbtjIFsEZx2aSk5mSWpRbp 2yVwZWz8m1cwRa5i49zDLA2MdyW6GDk4JARMJBb8ju1i5OIQEjjCKLFjdQcThLONUeLYg5ms XYycHGwCURI7DmxkB0mICNxjlOi4MJcRJCEs4C6xtmc6mM0ioCox78ImsAZegTiJrr3H2UFs CQE5ifPHfzKD2JwC8RIrdh9gAbGFgGp+Lj8FVS8ocXLmE7A4s4CExMEXL5hBrhMSsJG4t94F YoyCxIdZy9gmMPLPQtIxC0nHAkamVYyixanFSbnpRkZ6qUWZycXF+Xl6eaklmxiBoXlwy2+D HYwvnzseYhTgYFTi4Z0QciNKiDWxrLgy9xCjBAezkgiv+NnrUUK8KYmVValF+fFFpTmpxYcY pTlYlMR5Lfw2RwkJpCeWpGanphakFsFkmTg4pRoYVwUW35lxW+GA7olMwYwys6I5xwWLzft7 f1pda3swzWvXGvbzF1o+XIj+fz14F7+z4iG2q+8VTE7v9a9sv+s3P71v1tXcihsffp7OaZSN 6Miy4rcOkdiy5/LMZBtzGznhL/fmXku5cNwupmvpMUMFvyAztzoT/rCXS18cmHfZw1J47uJN i9mXK7EUZyQaajEXFScCAA7ullFJAgAA Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Acked-by: Jon Maloy Signed-off-by: GhantaKrishnamurthy MohanKrishna --- include/uapi/linux/tipc_netlink.h | 1 + net/tipc/bearer.c | 13 +++++++++++++ net/tipc/bearer.h | 3 +++ net/tipc/udp_media.h | 14 ++++++++++++++ 4 files changed, 31 insertions(+) diff --git a/include/uapi/linux/tipc_netlink.h b/include/uapi/linux/tipc_netlink.h index 0affb682e5e3..85c11982c89b 100644 --- a/include/uapi/linux/tipc_netlink.h +++ b/include/uapi/linux/tipc_netlink.h @@ -266,6 +266,7 @@ enum { TIPC_NLA_PROP_PRIO, /* u32 */ TIPC_NLA_PROP_TOL, /* u32 */ TIPC_NLA_PROP_WIN, /* u32 */ + TIPC_NLA_PROP_MTU, /* u32 */ __TIPC_NLA_PROP_MAX, TIPC_NLA_PROP_MAX = __TIPC_NLA_PROP_MAX - 1 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, goto prop_msg_full; if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, media->window)) goto prop_msg_full; + if (media->type_id == TIPC_MEDIA_TYPE_UDP) + if (nla_put_u32(msg->skb, TIPC_NLA_PROP_MTU, media->mtu)) + goto prop_msg_full; nla_nest_end(msg->skb, prop); nla_nest_end(msg->skb, attrs); @@ -1158,6 +1161,16 @@ int __tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info) m->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); if (props[TIPC_NLA_PROP_WIN]) m->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]); + if (props[TIPC_NLA_PROP_MTU]) { + if (m->type_id != TIPC_MEDIA_TYPE_UDP) + return -EINVAL; +#ifdef CONFIG_TIPC_MEDIA_UDP + if (tipc_udp_mtu_bad(nla_get_u32 + (props[TIPC_NLA_PROP_MTU]))) + return -EINVAL; + m->mtu = nla_get_u32(props[TIPC_NLA_PROP_MTU]); +#endif + } } return 0; diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index 6efcee63a381..394290cbbb1d 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h @@ -94,6 +94,8 @@ struct tipc_bearer; * @priority: default link (and bearer) priority * @tolerance: default time (in ms) before declaring link failure * @window: default window (in packets) before declaring link congestion + * @mtu: max packet size bearer can support for media type not dependent on + * underlying device MTU * @type_id: TIPC media identifier * @hwaddr_len: TIPC media address len * @name: media name @@ -118,6 +120,7 @@ struct tipc_media { u32 priority; u32 tolerance; u32 window; + u32 mtu; u32 type_id; u32 hwaddr_len; char name[TIPC_MAX_MEDIA_NAME]; diff --git a/net/tipc/udp_media.h b/net/tipc/udp_media.h index 281bbae87726..e7455cc73e16 100644 --- a/net/tipc/udp_media.h +++ b/net/tipc/udp_media.h @@ -38,9 +38,23 @@ #ifndef _TIPC_UDP_MEDIA_H #define _TIPC_UDP_MEDIA_H +#include +#include + int tipc_udp_nl_bearer_add(struct tipc_bearer *b, struct nlattr *attr); int tipc_udp_nl_add_bearer_data(struct tipc_nl_msg *msg, struct tipc_bearer *b); int tipc_udp_nl_dump_remoteip(struct sk_buff *skb, struct netlink_callback *cb); +/* check if configured MTU is too low for tipc headers */ +static inline bool tipc_udp_mtu_bad(u32 mtu) +{ + if (mtu >= (TIPC_MIN_BEARER_MTU + sizeof(struct iphdr) + + sizeof(struct udphdr))) + return false; + + pr_warn("MTU too low for tipc bearer\n"); + return true; +} + #endif #endif From patchwork Thu Apr 19 09:06:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: GhantaKrishnamurthy MohanKrishna X-Patchwork-Id: 900712 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ericsson.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ericsson.com header.i=@ericsson.com header.b="g0T/3REX"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40RY5P16Jhz9s2M for ; Thu, 19 Apr 2018 19:06:49 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750799AbeDSJGq (ORCPT ); Thu, 19 Apr 2018 05:06:46 -0400 Received: from sesbmg22.ericsson.net ([193.180.251.48]:46002 "EHLO sesbmg22.ericsson.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751168AbeDSJGj (ORCPT ); Thu, 19 Apr 2018 05:06:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1524128798; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=iT5cKEpCzvGnQ1S4UHaJT5OfQ1aHtlK7ag1IsvpWhgU=; b=g0T/3REXb37d+nK1/bSFb/lJ7pQinoPOcfJ+izpKYJLUbUOD+Ic+fksrd6Izewpy N/193k6Jm6dwRPMqG6MGO4J2gtT189NmOxigMNR359GOTGQuM01BOJmTz7o36r+i rxIBGaefX34OKlQJr9Su4t/H6Xnls4UGjGw+iKqYhcA=; X-AuditID: c1b4fb30-4c8039c000007681-4d-5ad85c1e73ea Received: from ESESSHC011.ericsson.se (Unknown_Domain [153.88.183.51]) by sesbmg22.ericsson.net (Symantec Mail Security) with SMTP id 96.CF.30337.E1C58DA5; Thu, 19 Apr 2018 11:06:38 +0200 (CEST) Received: from daly.lab.linux.ericsson.se (10.35.28.123) by ESESSHC011.ericsson.se (153.88.183.51) with Microsoft SMTP Server (TLS) id 14.3.382.0; Thu, 19 Apr 2018 11:06:35 +0200 From: GhantaKrishnamurthy MohanKrishna To: , , , , , , Subject: [net-next 3/3] tipc: confgiure and apply UDP bearer MTU on running links Date: Thu, 19 Apr 2018 11:06:20 +0200 Message-ID: <1524128780-2550-4-git-send-email-mohan.krishna.ghanta.krishnamurthy@ericsson.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1524128780-2550-1-git-send-email-mohan.krishna.ghanta.krishnamurthy@ericsson.com> References: <1524128780-2550-1-git-send-email-mohan.krishna.ghanta.krishnamurthy@ericsson.com> MIME-Version: 1.0 X-Originating-IP: [10.35.28.123] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBLMWRmVeSWpSXmKPExsUyM2K7sa5czI0og6PtchZzzrewWCxadJjJ 4tgCMYst57MsHl+/zuzA6rFl5U0mj/c9V5g8di/4zOTxeZOcx/otW5kCWKO4bFJSczLLUov0 7RK4Mp63PWIr6FKo2Pb+NnMD40WpLkZODgkBE4n7H/6ydDFycQgJHGGUWNI3kx3C2cYo8fLP NEaQKjaBKIkdBzaCJUQE7jFKdFyYC5YQFgiS+LurG8xmEVCVeHd+HxuIzSsQJzF3zXc2iBVy EueP/2QGsTkF4iVW7D7AAmILAdX8XH6KFaJeUOLkzCdgcWYBCYmDL14A1XMA1dhI3FvvAjFG QeLDrGVsExj5ZyHpmIWkYwEj0ypG0eLU4qTcdCMjvdSizOTi4vw8vbzUkk2MwPA8uOW3wQ7G l88dDzEKcDAq8fBOCLkRJcSaWFZcmXuIUYKDWUmEV/zs9Sgh3pTEyqrUovz4otKc1OJDjNIc LErivBZ+m6OEBNITS1KzU1MLUotgskwcnFINjD5ZGXOnuJ26tkfjouz/ep0Yo89KV1xm1q8p nrvNI32tQmhp5UV1u/UmE741dS3bkct8ROLk8+nsip+nHrz09gDH3ewzHL5pXyevK/gmmPPh g/39/UK717OWZdaKyyRs2PAgWN4o6lpd9dpoBS9Zm+1WrgtK3sztdjbVeZWhtGhu/Iy3bRJO C5VYijMSDbWYi4oTAbW8gINLAgAA Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Signed-off-by: GhantaKrishnamurthy MohanKrishna --- net/tipc/bearer.c | 16 +++++++++++++++- net/tipc/node.c | 12 +++++++++--- net/tipc/node.h | 2 +- 3 files changed, 25 insertions(+), 5 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, goto prop_msg_full; if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, bearer->window)) goto prop_msg_full; + if (bearer->media->type_id == TIPC_MEDIA_TYPE_UDP) + if (nla_put_u32(msg->skb, TIPC_NLA_PROP_MTU, bearer->mtu)) + goto prop_msg_full; nla_nest_end(msg->skb, prop); @@ -979,12 +982,23 @@ int __tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) if (props[TIPC_NLA_PROP_TOL]) { b->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]); - tipc_node_apply_tolerance(net, b); + tipc_node_apply_property(net, b, TIPC_NLA_PROP_TOL); } if (props[TIPC_NLA_PROP_PRIO]) b->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); if (props[TIPC_NLA_PROP_WIN]) b->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]); + if (props[TIPC_NLA_PROP_MTU]) { + if (b->media->type_id != TIPC_MEDIA_TYPE_UDP) + return -EINVAL; +#ifdef CONFIG_TIPC_MEDIA_UDP + if (tipc_udp_mtu_bad(nla_get_u32 + (props[TIPC_NLA_PROP_MTU]))) + return -EINVAL; + b->mtu = nla_get_u32(props[TIPC_NLA_PROP_MTU]); + tipc_node_apply_property(net, b, TIPC_NLA_PROP_MTU); +#endif + } } return 0; diff --git a/net/tipc/node.c b/net/tipc/node.c index c77dd2f3c589..b71e4e376bb9 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -1681,7 +1681,8 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b) kfree_skb(skb); } -void tipc_node_apply_tolerance(struct net *net, struct tipc_bearer *b) +void tipc_node_apply_property(struct net *net, struct tipc_bearer *b, + int prop) { struct tipc_net *tn = tipc_net(net); int bearer_id = b->identity; @@ -1696,8 +1697,13 @@ void tipc_node_apply_tolerance(struct net *net, struct tipc_bearer *b) list_for_each_entry_rcu(n, &tn->node_list, list) { tipc_node_write_lock(n); e = &n->links[bearer_id]; - if (e->link) - tipc_link_set_tolerance(e->link, b->tolerance, &xmitq); + if (e->link) { + if (prop == TIPC_NLA_PROP_TOL) + tipc_link_set_tolerance(e->link, b->tolerance, + &xmitq); + else if (prop == TIPC_NLA_PROP_MTU) + tipc_link_set_mtu(e->link, b->mtu); + } tipc_node_write_unlock(n); tipc_bearer_xmit(net, bearer_id, &xmitq, &e->maddr); } diff --git a/net/tipc/node.h b/net/tipc/node.h index f24b83500df1..bb271a37c93f 100644 --- a/net/tipc/node.h +++ b/net/tipc/node.h @@ -67,7 +67,7 @@ void tipc_node_check_dest(struct net *net, u32 onode, u8 *peer_id128, struct tipc_media_addr *maddr, bool *respond, bool *dupl_addr); void tipc_node_delete_links(struct net *net, int bearer_id); -void tipc_node_apply_tolerance(struct net *net, struct tipc_bearer *b); +void tipc_node_apply_property(struct net *net, struct tipc_bearer *b, int prop); int tipc_node_get_linkname(struct net *net, u32 bearer_id, u32 node, char *linkname, size_t len); int tipc_node_xmit(struct net *net, struct sk_buff_head *list, u32 dnode,