Re: [PATCH V5 net-next 05/11] net: hibmcge: Implement some .ndo functions
From: Jijie Shao <shaojijie@huawei.com>
Date: 2024-08-29 02:40:11
Also in:
lkml
From: Jijie Shao <shaojijie@huawei.com>
Date: 2024-08-29 02:40:11
Also in:
lkml
on 2024/8/29 9:39, Jakub Kicinski wrote:
On Tue, 27 Aug 2024 21:14:49 +0800 Jijie Shao wrote:quoted
+static int hbg_net_open(struct net_device *dev) +{ + struct hbg_priv *priv = netdev_priv(dev); + + if (test_and_set_bit(HBG_NIC_STATE_OPEN, &priv->state)) + return 0; + + netif_carrier_off(dev);Why clear the carrier during open? You should probably clear it once on the probe path and then on stop.
In net_open(), the GMAC is not ready to receive or transmit packets. Therefore, netif_carrier_off() is called. Packets can be received or transmitted only after the PHY is linked. Therefore, netif_carrier_on() should be called in adjust_link. In net_stop() we also call netif_carrier_off() Thanks, Jijie Shao