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,