From: Florian Fainelli Subject: Re: [PATCH v2] ravb: add support for changing MTU Date: Fri, 16 Feb 2018 11:45:17 -0800 Message-ID: References: <20180216161008.12882-1-niklas.soderlund+renesas@ragnatech.se> <4a960952-1283-275d-f2f9-1311c9468813@cogentembedded.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: linux-renesas-soc@vger.kernel.org To: Sergei Shtylyov , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , "David S . Miller" , netdev@vger.kernel.org Return-path: In-Reply-To: <4a960952-1283-275d-f2f9-1311c9468813@cogentembedded.com> Content-Language: en-US Sender: linux-renesas-soc-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 02/16/2018 11:43 AM, Sergei Shtylyov wrote: > Hello! > > On 02/16/2018 10:42 PM, Florian Fainelli wrote: > >>> Allow for changing the MTU within the limit of the maximum size of a >>> descriptor (2048 bytes). Add the callback to change MTU from user-space >>> and take the configurable MTU into account when configuring the >>> hardware. >>> >>> Signed-off-by: Niklas Söderlund >>> --- >> >>> >>> +static int ravb_change_mtu(struct net_device *ndev, int new_mtu) >>> +{ >>> + if (netif_running(ndev)) >>> + return -EBUSY; >>> + >>> + ndev->mtu = new_mtu; >>> + netdev_update_features(ndev); >> >> Don't you somehow need to quiesce the RX DMA and make sure you that you >> re-allocate all RX buffers within priv->rx_skb[q][entry] such that they >> will be able to accept a larger buffer size? >> >> If we put the ravb interface under high RX load and we change the MTU on >> the fly, can we crash the kernel? > > I thought the netif_running() check guards against that. Does it not? It does, completely missed that, thanks! -- Florian