netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jijie Shao <shaojijie@huawei.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
	<shenjian15@huawei.com>, <wangpeiyang1@huawei.com>,
	<liuyonglong@huawei.com>, <chenhao418@huawei.com>,
	<sudongming1@huawei.com>, <xujunsheng@huawei.com>,
	<shiyongbang@huawei.com>, <libaihan@huawei.com>, <andrew@lunn.ch>,
	<jdamato@fastly.com>, <horms@kernel.org>,
	<jonathan.cameron@huawei.com>,
	<shameerali.kolothum.thodi@huawei.com>, <salil.mehta@huawei.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V5 net-next 05/11] net: hibmcge: Implement some .ndo functions
Date: Thu, 29 Aug 2024 07:43:39 -0700	[thread overview]
Message-ID: <20240829074339.426e298b@kernel.org> (raw)
In-Reply-To: <b3d6030e-14a3-4d5f-815c-2f105f49ea6a@huawei.com>

On Thu, 29 Aug 2024 10:40:07 +0800 Jijie Shao wrote:
> on 2024/8/29 9:39, Jakub Kicinski wrote:
> > On Tue, 27 Aug 2024 21:14:49 +0800 Jijie Shao wrote:  
> >> +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.

But why are you calling _off() during .ndo_open() ?
Surely the link is also off before ndo_open is called?

> In net_stop() we also call netif_carrier_off()

Exactly, so it should already be off.

  reply	other threads:[~2024-08-29 14:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 13:14 [PATCH V5 net-next 00/11] Add support of HIBMCGE Ethernet Driver Jijie Shao
2024-08-27 13:14 ` [PATCH V5 net-next 01/11] net: hibmcge: Add pci table supported in this module Jijie Shao
2024-08-27 13:14 ` [PATCH V5 net-next 02/11] net: hibmcge: Add read/write registers supported through the bar space Jijie Shao
2024-08-27 13:14 ` [PATCH V5 net-next 03/11] net: hibmcge: Add mdio and hardware configuration supported in this module Jijie Shao
2024-08-27 13:14 ` [PATCH V5 net-next 04/11] net: hibmcge: Add interrupt " Jijie Shao
2024-08-29  1:35   ` Jakub Kicinski
2024-08-29  1:54     ` Jijie Shao
2024-08-29  2:12       ` Jakub Kicinski
2024-08-29 13:02         ` Jijie Shao
2024-08-27 13:14 ` [PATCH V5 net-next 05/11] net: hibmcge: Implement some .ndo functions Jijie Shao
2024-08-29  1:39   ` Jakub Kicinski
2024-08-29  2:40     ` Jijie Shao
2024-08-29 14:43       ` Jakub Kicinski [this message]
2024-08-29 14:59         ` Andrew Lunn
2024-08-30  2:27           ` Jijie Shao
2024-08-27 13:14 ` [PATCH V5 net-next 06/11] net: hibmcge: Implement .ndo_start_xmit function Jijie Shao
2024-08-29  1:41   ` Jakub Kicinski
2024-08-29  2:32     ` Jijie Shao
2024-08-29  3:02       ` Andrew Lunn
2024-08-29 12:57         ` Jijie Shao
     [not found]         ` <f64c04a6-8c3d-46f5-a2dd-a9864de12169@huawei.com>
2024-08-29 13:16           ` Andrew Lunn
2024-08-30 12:27             ` Jijie Shao
2024-08-29 14:51       ` Jakub Kicinski
2024-08-27 13:14 ` [PATCH V5 net-next 07/11] net: hibmcge: Implement rx_poll function to receive packets Jijie Shao
2024-08-27 13:14 ` [PATCH V5 net-next 08/11] net: hibmcge: Implement some ethtool_ops functions Jijie Shao
2024-08-27 13:14 ` [PATCH V5 net-next 09/11] net: hibmcge: Add a Makefile and update Kconfig for hibmcge Jijie Shao
2024-08-27 13:14 ` [PATCH V5 net-next 10/11] net: hibmcge: Add maintainer " Jijie Shao
2024-08-27 13:14 ` [PATCH V5 net-next 11/11] net: add ndo_validate_addr check in dev_set_mac_address Jijie Shao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240829074339.426e298b@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=chenhao418@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=libaihan@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyonglong@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=salil.mehta@huawei.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=shaojijie@huawei.com \
    --cc=shenjian15@huawei.com \
    --cc=shiyongbang@huawei.com \
    --cc=sudongming1@huawei.com \
    --cc=wangpeiyang1@huawei.com \
    --cc=xujunsheng@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).