[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240915171410.2c4dc951@kernel.org>
Date: Sun, 15 Sep 2024 17:14:10 +0200
From: Jakub Kicinski <kuba@...nel.org>
To: Jijie Shao <shaojijie@...wei.com>
Cc: <davem@...emloft.net>, <edumazet@...gle.com>, <pabeni@...hat.com>,
<shenjian15@...wei.com>, <wangpeiyang1@...wei.com>,
<liuyonglong@...wei.com>, <chenhao418@...wei.com>,
<sudongming1@...wei.com>, <xujunsheng@...wei.com>,
<shiyongbang@...wei.com>, <libaihan@...wei.com>, <andrew@...n.ch>,
<jdamato@...tly.com>, <horms@...nel.org>,
<kalesh-anakkur.purayil@...adcom.com>, <jonathan.cameron@...wei.com>,
<shameerali.kolothum.thodi@...wei.com>, <salil.mehta@...wei.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V10 net-next 05/10] net: hibmcge: Implement some .ndo
functions
On Thu, 12 Sep 2024 10:51:22 +0800 Jijie Shao wrote:
> +static int hbg_net_change_mtu(struct net_device *netdev, int new_mtu)
> +{
> + struct hbg_priv *priv = netdev_priv(netdev);
> + bool is_running = netif_running(netdev);
> +
> + if (is_running)
> + hbg_net_stop(netdev);
> +
> + hbg_change_mtu(priv, new_mtu);
> + WRITE_ONCE(netdev->mtu, new_mtu);
> +
> + dev_dbg(&priv->pdev->dev,
> + "change mtu from %u to %u\n", netdev->mtu, new_mtu);
> + if (is_running)
> + hbg_net_open(netdev);
What if open() fails? You either have to pre-allocate the new resources
or find a way of resetting without reallocating memory. Or return -EBUSY
if interface is running
Powered by blists - more mailing lists