Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp573798pxb; Fri, 13 Aug 2021 01:14:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXtKrKbJ2qypmYl4fJ7M0QA/tRmO7Tyft0j3vdHpacFNQabwG6UmMMaY1fXVRLMrqibq1g X-Received: by 2002:a17:907:35d0:: with SMTP id ap16mr1283326ejc.456.1628842482230; Fri, 13 Aug 2021 01:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628842482; cv=none; d=google.com; s=arc-20160816; b=WqztNUoZOQ6meigX2O1t1C1s9/aVDPnlkDcgtY+L0YpFd29SYJsMECsvgWdur/EVqL vQma8sLvAOOlNMN2xg0TXpAm7gCkpKMznOQhRzTsxYPywht6QQBGkSDx2COkRDGcfgF7 I2nJ0aosA0n2U6NNght00bC/rkPc6Y+gcRAcQBV4rJvlUyDvSY3vSBhVbUqZoRPUBZAJ RMHWRtiZcNoGih1BCup0OneOT8NKSDjmWM/qhTjku0c1kc2S5AT1E8V8r0a2q0/+kxiq +j51VZ/BMzSzLxMu2CkWO1wew2wE/0cBEGYW0bUh2BfCpQqPV6jp6vEYTsu7Yh61aXGY j/1g== 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=pTJK2ENotOLWUuxPtdS4ygoCgz6iafT852tk9GFodWo=; b=TwCadLu9w42yv9qBp1yq0lEIEdxEpMyX8QTSvRo6pYN1bOC1X+3YroMbTXl5BdrKWe +SJ2il0QVIBZRSdJE0FsJoGabHmBJ1mgu47smURpKewK4Mp2sKBfcR0qOes66skncu0V TwINciQjAf8fEJnO5z0NbnZqkSSGGWIYb2AcWeJcrMaGitHkF5z9ed9qhdaXsFtM0Ico j8hkEsYLP3B13w72r8ZeUwgX6ZjVT7+DDJIy+OuuIqZgTXtJR98lpUMaMjdN0qrzWMzz 71WqGzTrgNhr/rhzjB19A5KRzzUUAQmCu8fScIT6Fy0bvPHqoOYNXxATenx/fBeiKOyZ VDBQ== 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 jz19si1143111ejb.599.2021.08.13.01.14.18; Fri, 13 Aug 2021 01:14:42 -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 S239725AbhHMIKg (ORCPT + 99 others); Fri, 13 Aug 2021 04:10:36 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:44220 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S239668AbhHMIKg (ORCPT ); Fri, 13 Aug 2021 04:10:36 -0400 X-UUID: b8752efb16e1441f8b6b43d798f983b8-20210813 X-UUID: b8752efb16e1441f8b6b43d798f983b8-20210813 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1910488043; Fri, 13 Aug 2021 16:10:07 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkexhb02.mediatek.inc (172.21.101.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 13 Aug 2021 16:10:06 +0800 Received: from localhost.localdomain (10.15.20.246) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 13 Aug 2021 16:10:05 +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: Fri, 13 Aug 2021 16:07:40 +0800 Message-ID: <20210813080740.31571-1-rocco.yue@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <4624cc10-1fc8-12cd-e9e1-9585f5b496a0@gmail.com> References: <4624cc10-1fc8-12cd-e9e1-9585f5b496a0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-08-11 at 12:05 -0600, David Ahern wrote: > On 8/11/21 7:56 AM, David Ahern wrote: >> On 8/10/21 6:33 AM, Rocco Yue wrote: >>> On Mon, 2021-08-09 at 16:43 -0600, David Ahern wrote: >>>> >>>> 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)" ? >>> >> >> looks like nothing under: >> if (ndopts.nd_opts_mtu && in6_dev->cnf.accept_ra_mtu) { >> >> } >> >> is going to send a link notification so you can just replace >> inet6_iframtu_notify with rtmsg_ifinfo in your proposed change. >> > > Taking a deeper dive on the code, you do not need to call rtmsg_ifinfo. > Instead, the existing: > > /* > * Send a notify if RA changed managed/otherconf flags or > timer settings > */ > if (send_ifinfo_notify) > inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); > > is called too early. For one the RA can change the MTU and that is done > after this notify. > > I think if you moved this down to the out: > > out: > /* > * Send a notify if RA changed managed/otherconf flags or > timer settings > */ > if (send_ifinfo_notify) > inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); > > and then set send_ifinfo_notify when the mtu is *changed* by the RA you > should be good. Hi David, Thanks for your suggestion, this looks like a better choice without adding a separate notification function, I will modify it and push the next iteration . Best Regards, Rocco