netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Fan Gong <gongfan1@huawei.com>
Cc: andrew+netdev@lunn.ch, christophe.jaillet@wanadoo.fr,
	corbet@lwn.net, davem@davemloft.net, edumazet@google.com,
	guoxin09@huawei.com, gur.stavi@huawei.com, helgaas@kernel.org,
	jdamato@fastly.com, kuba@kernel.org, lee@trager.us,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	luosifu@huawei.com, luoyang82@h-partners.com,
	meny.yossefi@huawei.com, mpe@ellerman.id.au,
	netdev@vger.kernel.org, pabeni@redhat.com,
	przemyslaw.kitszel@intel.com, shenchenyang1@hisilicon.com,
	shijing34@huawei.com, sumang@marvell.com,
	vadim.fedorenko@linux.dev, wulike1@huawei.com,
	zhoushuai28@huawei.com, zhuyikai1@h-partners.com
Subject: Re: [PATCH net-next v05 12/14] hinic3: Add port management
Date: Fri, 12 Sep 2025 17:44:46 +0100	[thread overview]
Message-ID: <20250912164446.GA224143@horms.kernel.org> (raw)
In-Reply-To: <20250911142504.2518-1-gongfan1@huawei.com>

On Thu, Sep 11, 2025 at 10:25:04PM +0800, Fan Gong wrote:
> On 9/11/2025 8:33 PM, Simon Horman wrote:
> 
> > > +	err = hinic3_get_link_status(nic_dev->hwdev, &link_status_up);
> > > +	if (!err && link_status_up)
> > > +		netif_carrier_on(netdev);
> > > +
> > > +	return 0;
> > > +
> > > +err_flush_qps_res:
> > > +	hinic3_flush_qps_res(nic_dev->hwdev);
> > > +	/* wait to guarantee that no packets will be sent to host */
> > > +	msleep(100);
> > 
> > I realise that Jakub's feedback on msleep() in his review of v3 was
> > in a different code path. But I do wonder if there is a better way.
> 
> ...
> 
> > > +	hinic3_flush_txqs(netdev);
> > > +	/* wait to guarantee that no packets will be sent to host */
> > > +	msleep(100);
> > 
> > Likewise, here.
> 
> Thanks for your review, Simon.
> 
> Firstly, The main issue on the code of Jakub's feedback on msleep() is
> duplicate code function. The msleep() in hinic3_vport_down and
> hinic3_free_hwdev is repetitive because of our oversight. So we removed
> msleep() in hinic3_free_hwdev in v04 patch.
> 
> Secondly, there is no better way indeed. As our HW bad decision, HW 
> didn't have an accurate way of checking if rq has been flushed. The
> only way is to close the func & port . Then we wait for HW to process
> the pkts and upload them to driver. 
> The sleep time is determined through our testing. The two calls of
> msleep() are the same issue.

Thanks for the clarification, much appreciated.

> Finally, we have received your reviews on other patches and we will
> fix them soon in the next version.
> 

  reply	other threads:[~2025-09-12 16:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09  7:33 [PATCH net-next v05 00/14] net: hinic3: Add a driver for Huawei 3rd gen NIC - sw and hw initialization Fan Gong
2025-09-09  7:33 ` [PATCH net-next v05 01/14] hinic3: HW initialization Fan Gong
2025-09-09  7:33 ` [PATCH net-next v05 02/14] hinic3: HW management interfaces Fan Gong
2025-09-09  7:33 ` [PATCH net-next v05 03/14] hinic3: HW common function initialization Fan Gong
2025-09-11 12:31   ` Simon Horman
2025-09-09  7:33 ` [PATCH net-next v05 04/14] hinic3: HW capability initialization Fan Gong
2025-09-09  7:33 ` [PATCH net-next v05 05/14] hinic3: Command Queue flush interfaces Fan Gong
2025-09-09  7:33 ` [PATCH net-next v05 06/14] hinic3: Nic_io initialization Fan Gong
2025-09-09  7:33 ` [PATCH net-next v05 07/14] hinic3: Queue pair endianness improvements Fan Gong
2025-09-11 12:31   ` Simon Horman
2025-09-09  7:33 ` [PATCH net-next v05 08/14] hinic3: Queue pair resource initialization Fan Gong
2025-09-11 12:32   ` Simon Horman
2025-09-09  7:33 ` [PATCH net-next v05 09/14] hinic3: Queue pair context initialization Fan Gong
2025-09-11 12:30   ` Simon Horman
2025-09-09  7:33 ` [PATCH net-next v05 10/14] hinic3: Tx & Rx configuration Fan Gong
2025-09-09  7:33 ` [PATCH net-next v05 11/14] hinic3: Add Rss function Fan Gong
2025-09-09  7:33 ` [PATCH net-next v05 12/14] hinic3: Add port management Fan Gong
2025-09-11 12:33   ` Simon Horman
2025-09-11 14:25     ` Fan Gong
2025-09-12 16:44       ` Simon Horman [this message]
2025-09-09  7:33 ` [PATCH net-next v05 13/14] hinic3: Fix missing napi->dev in netif_queue_set_napi Fan Gong
2025-09-09  7:33 ` [PATCH net-next v05 14/14] hinic3: Fix code style (Missing a blank line before return) Fan Gong

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=20250912164446.GA224143@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gongfan1@huawei.com \
    --cc=guoxin09@huawei.com \
    --cc=gur.stavi@huawei.com \
    --cc=helgaas@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=kuba@kernel.org \
    --cc=lee@trager.us \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luosifu@huawei.com \
    --cc=luoyang82@h-partners.com \
    --cc=meny.yossefi@huawei.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=shenchenyang1@hisilicon.com \
    --cc=shijing34@huawei.com \
    --cc=sumang@marvell.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=wulike1@huawei.com \
    --cc=zhoushuai28@huawei.com \
    --cc=zhuyikai1@h-partners.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).