From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D513CC433EF for ; Thu, 16 Jun 2022 12:05:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RTWeMhi2Z4ifXcJcyOdkyyFfYq4F0tchTiBihjCX0cw=; b=BUfJlUnpGCAJOA R9F8jEWXVuNIoN2r5hg3TLkdehvklR559gXAdzTfZ1RyReNYmQd/xXAZzHnl/zdldQbQGvwj23DNr xE+ydZNVnISqKyIDZCRCwGXYtinWAw9p9vKrvJi7bbkVpRyEOxwS4jR8E9h9GxLkYNcQXRufP2XVz Sy5OwiwKJ81v7q3AIZbX6dvF2MFGqU6ophlB5tA2LlJ+GavU3FlLoqT+n4EqXunBd/P6epqjU0jsM N5AWdMW+QE42zodS4nRE8iqefSeZorK409QKZjcD45M6X+fekl3K1/o0wyzbvkqoe5YBbXk7HCsYt 4kn4BCsPE6WNHfWRKjwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1oEN-002DuN-DJ; Thu, 16 Jun 2022 12:04:11 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1oEK-002DtD-Cp for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2022 12:04:09 +0000 Received: by mail-wr1-x430.google.com with SMTP id v14so1588941wra.5 for ; Thu, 16 Jun 2022 05:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:from:to:cc:subject:references:mime-version :content-disposition:in-reply-to; bh=NvTotWv8XnzVZu+pHQebgM4bWsTTZKNeIdjOwDoju7E=; b=FW7I1cA/aAcawnoclOF3N/CI0+ENH8qb6obcOzoQ6ODb2/OGq0INjFy8zF8ZxnNa20 XLceFXJ3I08a7I7hyt26nZjN+3I4pehoxfIVgpkM11DhEh3oef7rnCC5X0ile71OJtCN xaBtR2bmdVgf8LreqXb4Ahr+9eqK6QePgB1O6OxUudDYvuk7EZASerj/LCDO9nJJvLBb 7Hju6O1R+SHO/mTFJ4/V3GxBq2l1IZzF6EDusy63YRAMNLbhyRLIpa4/yDWq9PuCnMa2 AEvKYYTowKDUBPWQCc8VlqIyLVWBINn/5sxWbrFJssiHVtuC7/AW6NidGcJcuk1zLBnT /SXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:from:to:cc:subject:references :mime-version:content-disposition:in-reply-to; bh=NvTotWv8XnzVZu+pHQebgM4bWsTTZKNeIdjOwDoju7E=; b=BJMuwFZwupYdWRePyz9ZQc62FsXlDhItbR29EDXeUMZLLYSBu/OpuRG628pt70LRr4 osldiEkYtRzQQ5IRJxHWIDRmRwoUTlPYhhe7GxU89V9EFfZnLRR93JUy1aKOOkrRvliO 9lcil8UdBIlDv6KWyxu12x1JZp05ELwtX4HdSX/99OmoTRNVPzfTGkqbiuaYaFSUTg79 HNbwR9B+7cF0hiHkWcb9H1MZD7FIm+hCqzOKYOSxvLsjWcxaxSBepDRWcFLDwW8tmAoN x+AL2rJwrXWQmAHZ9awX3O3MYezynLO0G5Kmb/2Y3/9iJSduOkNwI5wLP7JdxT7ha4I6 wBgQ== X-Gm-Message-State: AJIora8Zaqr6hypx5K784wb1tVb4PwmxbHWpxt1IWUxtfnL7et9iuzLr 7UiUSt52j+OQhKny+ggVbtM/WY/O0sc= X-Google-Smtp-Source: AGRyM1vGe0hqTNQlFi19vRGu0VDlfq55drHnbDnjclViV5t5NFO8MwRfAtbD0ugYV3SFtgr/4mg+fw== X-Received: by 2002:a5d:6a0e:0:b0:213:1f7f:e1cc with SMTP id m14-20020a5d6a0e000000b002131f7fe1ccmr4373123wru.31.1655381046289; Thu, 16 Jun 2022 05:04:06 -0700 (PDT) Received: from Ansuel-xps. (93-42-70-190.ip85.fastwebnet.it. [93.42.70.190]) by smtp.gmail.com with ESMTPSA id f3-20020adff583000000b002100316b126sm1700890wro.6.2022.06.16.05.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 05:04:05 -0700 (PDT) Message-ID: <62ab1c35.1c69fb81.9ea8e.2cb0@mx.google.com> X-Google-Original-Message-ID: Date: Thu, 16 Jun 2022 14:04:03 +0200 From: Ansuel Smith To: Jakub Kicinski Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [net-next PATCH] net: ethernet: stmicro: stmmac: permit MTU change with interface up References: <20220614224141.23576-1-ansuelsmth@gmail.com> <20220615195507.52ee19df@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220615195507.52ee19df@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220616_050408_492411_CBC308B7 X-CRM114-Status: GOOD ( 15.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 15, 2022 at 07:55:07PM -0700, Jakub Kicinski wrote: > On Wed, 15 Jun 2022 00:41:41 +0200 Christian 'Ansuel' Marangi wrote: > > + if (netif_running(dev)) { > > + netdev_dbg(priv->dev, "restarting interface to change its MTU\n"); > > + stmmac_release(dev); > > + > > + stmmac_open(dev); > > + stmmac_set_filter(priv, priv->hw, dev); > > What if stmmac_open() fails because the memory is low or is fragmented? > > You'd need to invest more effort into this change and try to allocate > all the resources before shutting the device down. Well what I'm doing here is following what is done with other similar function in stmmac. For example the reinit_queues and reinit_ringparam doesn't do such check. But ok you are right, will see a good solution to change stmmac_open to preallocate the buffers. -- Ansuel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55643C43334 for ; Thu, 16 Jun 2022 12:04:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377032AbiFPMEQ (ORCPT ); Thu, 16 Jun 2022 08:04:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377055AbiFPMEI (ORCPT ); Thu, 16 Jun 2022 08:04:08 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1214A5F262; Thu, 16 Jun 2022 05:04:08 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id c21so1602868wrb.1; Thu, 16 Jun 2022 05:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:from:to:cc:subject:references:mime-version :content-disposition:in-reply-to; bh=NvTotWv8XnzVZu+pHQebgM4bWsTTZKNeIdjOwDoju7E=; b=FW7I1cA/aAcawnoclOF3N/CI0+ENH8qb6obcOzoQ6ODb2/OGq0INjFy8zF8ZxnNa20 XLceFXJ3I08a7I7hyt26nZjN+3I4pehoxfIVgpkM11DhEh3oef7rnCC5X0ile71OJtCN xaBtR2bmdVgf8LreqXb4Ahr+9eqK6QePgB1O6OxUudDYvuk7EZASerj/LCDO9nJJvLBb 7Hju6O1R+SHO/mTFJ4/V3GxBq2l1IZzF6EDusy63YRAMNLbhyRLIpa4/yDWq9PuCnMa2 AEvKYYTowKDUBPWQCc8VlqIyLVWBINn/5sxWbrFJssiHVtuC7/AW6NidGcJcuk1zLBnT /SXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:from:to:cc:subject:references :mime-version:content-disposition:in-reply-to; bh=NvTotWv8XnzVZu+pHQebgM4bWsTTZKNeIdjOwDoju7E=; b=awlF6vR41aE2Rf5A4/ITvy/GAQ8G8HPoF7HFqDQOrgr5/YEF+OczLxt8PgD/uBfNIS Aqk4FMGYWBTz4Cu24S1CrsLfQVYMB2bdt21QGtbk7QXmJc5bbU4EGnYgu4J9jez1CoG8 xAyLCYTcXptUo3G3Ju15UEsDiOOwdQwNdHwZOOyjF7ngXzP1qLo1XerwdTMumxjQsyvo 2k7D7jkf3GXw1yzrXgwJjdRuls7CzKfkuxG7xKHbek+bgP0lvFL/eCUfiHsNzpev0zZx UIP+L/ekmTfIfEMjkcT4xtVeSQ2xzBfWfeGjgS7UK399iVEPy5okLg5zMIwueoc6wdOD uaGA== X-Gm-Message-State: AJIora8wYlJ2UDgKHVIBRV7fi5LV19JmiCFWlfnVDqHn82TDnsQESq/Q QAiAS2xpVDnPZyOLCKvhp4M= X-Google-Smtp-Source: AGRyM1vGe0hqTNQlFi19vRGu0VDlfq55drHnbDnjclViV5t5NFO8MwRfAtbD0ugYV3SFtgr/4mg+fw== X-Received: by 2002:a5d:6a0e:0:b0:213:1f7f:e1cc with SMTP id m14-20020a5d6a0e000000b002131f7fe1ccmr4373123wru.31.1655381046289; Thu, 16 Jun 2022 05:04:06 -0700 (PDT) Received: from Ansuel-xps. (93-42-70-190.ip85.fastwebnet.it. [93.42.70.190]) by smtp.gmail.com with ESMTPSA id f3-20020adff583000000b002100316b126sm1700890wro.6.2022.06.16.05.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 05:04:05 -0700 (PDT) Message-ID: <62ab1c35.1c69fb81.9ea8e.2cb0@mx.google.com> X-Google-Original-Message-ID: Date: Thu, 16 Jun 2022 14:04:03 +0200 From: Ansuel Smith To: Jakub Kicinski Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [net-next PATCH] net: ethernet: stmicro: stmmac: permit MTU change with interface up References: <20220614224141.23576-1-ansuelsmth@gmail.com> <20220615195507.52ee19df@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220615195507.52ee19df@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 15, 2022 at 07:55:07PM -0700, Jakub Kicinski wrote: > On Wed, 15 Jun 2022 00:41:41 +0200 Christian 'Ansuel' Marangi wrote: > > + if (netif_running(dev)) { > > + netdev_dbg(priv->dev, "restarting interface to change its MTU\n"); > > + stmmac_release(dev); > > + > > + stmmac_open(dev); > > + stmmac_set_filter(priv, priv->hw, dev); > > What if stmmac_open() fails because the memory is low or is fragmented? > > You'd need to invest more effort into this change and try to allocate > all the resources before shutting the device down. Well what I'm doing here is following what is done with other similar function in stmmac. For example the reinit_queues and reinit_ringparam doesn't do such check. But ok you are right, will see a good solution to change stmmac_open to preallocate the buffers. -- Ansuel