Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3708486pxt; Tue, 10 Aug 2021 09:31:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdEoIIGPqafSbypd3J6dv2cT7nZ/kU6DAjd6FV0/CiYT4FhvrG7iSEyHgSN1aS7jAAN69q X-Received: by 2002:a17:906:4c5a:: with SMTP id d26mr7689733ejw.317.1628613071569; Tue, 10 Aug 2021 09:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628613071; cv=none; d=google.com; s=arc-20160816; b=BXatB0MySM8DGBmopXAJ6tLhRF6OlsSMdXIyZqzGnuV4q8SQr0e5Lir4QuejM60fMg 6SfDqpW0HZ9t1NreQpW6xUzlplI8drLvxyJ/e8HW6Q7f5bilGEZXtqkCuK4JgnSMAbxQ Oe3EISZjo8jt+HOAkeRgnyOeCMzPXRciWwNbOJ/qy6bcwlMzhLr7t+51ME2m/iGHeuZz NLI4GT7dTuTrpncpWdQDWCBpObzkjj2ZTYKGgn6v0YtcdDm7HjYjv5t4Yf38WSKWicQh qq+S5a3Y/0VoZ6WeF7hQdB3n3yE/YrFbX6yzzCR3z9wDacssMMo8vCwWWV57UrKFMRbo /9Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=b6HFormh3DxmEL3Ci+KEXtq1oIpFVtzKIY6uxcj5ok8=; b=PiFS2IskpW77HDz+o+jOirm6JCoreUlgdf1AZKv/E8yrKjlNNlRImzxD2UUXxQjFyP AQ+dypCAEfmVZmNofkENIzzrrazB1KGV5ER6+2wjkBnUCDLTFh9K7tPVxQi2JtcD/NT5 u5T3yHukrEMaF2gsR8/lX2pO5avQrq14mQfpiWXUImQygbs2vxcY59KnZ6Fufgq6Q/mB 2IeznONGRDVvl3UwgWx4oVhVv+CfLun0Tow2Ads9BpKuNmp1iWocTrSts5Z3aHuscoS7 MojMAOzr5qtaLtmzIPQa/5kshtmvKMWGOQ77zXnOvwzuyMs/Pu4TxbxysE++jwd3KAVW VNng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o23si4872549edt.314.2021.08.10.09.30.44; Tue, 10 Aug 2021 09:31:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240597AbhHJMgB (ORCPT + 99 others); Tue, 10 Aug 2021 08:36:01 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:47416 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S236886AbhHJMfz (ORCPT ); Tue, 10 Aug 2021 08:35:55 -0400 X-UUID: 6f4aa03e1f494d4284d2cd45b99e0a48-20210810 X-UUID: 6f4aa03e1f494d4284d2cd45b99e0a48-20210810 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1365449332; Tue, 10 Aug 2021 20:35:30 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 10 Aug 2021 20:35:28 +0800 Received: from localhost.localdomain (10.15.20.246) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 10 Aug 2021 20:35:27 +0800 From: Rocco Yue To: David Ahern CC: "David S . Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Matthias Brugger , , , , , , , , Rocco Yue Subject: Re: [PATCH net-next v3] ipv6: add IFLA_INET6_RA_MTU to expose mtu value in the RA message Date: Tue, 10 Aug 2021 20:33:27 +0800 Message-ID: <20210810123327.15998-1-rocco.yue@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-08-09 at 16:43 -0600, David Ahern wrote: > On 8/9/21 8:01 AM, Rocco Yue wrote: > + >> #ifdef CONFIG_SYSCTL >> >> static int addrconf_sysctl_forward(struct ctl_table *ctl, int write, >> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c >> index c467c6419893..a04164cbd77f 100644 >> --- a/net/ipv6/ndisc.c >> +++ b/net/ipv6/ndisc.c >> @@ -1496,6 +1496,12 @@ static void ndisc_router_discovery(struct sk_buff *skb) >> memcpy(&n, ((u8 *)(ndopts.nd_opts_mtu+1))+2, sizeof(mtu)); >> mtu = ntohl(n); >> >> + if (in6_dev->ra_mtu != mtu) { >> + in6_dev->ra_mtu = mtu; >> + inet6_iframtu_notify(in6_dev); >> + ND_PRINTK(2, info, "update ra_mtu to %d\n", in6_dev->ra_mtu); >> + } >> + >> if (mtu < IPV6_MIN_MTU || mtu > skb->dev->mtu) { >> ND_PRINTK(2, warn, "RA: invalid mtu: %d\n", mtu); >> } else if (in6_dev->cnf.mtu6 != mtu) { > > Since this MTU is getting reported via af_info infrastructure, > rtmsg_ifinfo should be sufficient. > > From there use 'ip monitor' to make sure you are not generating multiple > notifications; you may only need this on the error path. Hi David, To avoid generating multiple notifications, I added a separate ramtu notify function in this patch, and I added RTNLGRP_IPV6_IFINFO nl_mgrp to the ipmonitor.c to verify this patch was as expected. I look at the rtmsg_ifinfo code, it should be appropriate and I will use it and verify it. But there's one thing, I'm sorry I didn't fully understand the meaning of this sentence "you may only need this on the error path". Honestly, I'm not sure what the error patch refers to, do you mean "if (mtu < IPV6_MIN_MTU || mtu > skb->dev->mtu)" ? Thanks Rocco