From: Jakub Kicinski <kuba@kernel.org>
To: Fan Gong <gongfan1@huawei.com>
Cc: <mohsin.bashr@gmail.com>, <andrew+netdev@lunn.ch>,
<august.hewei@huawei.com>, <chenanwen@huawei.com>,
<davem@davemloft.net>, <dimitri.daskalakis1@gmail.com>,
<edumazet@google.com>, <guoxin09@huawei.com>, <horms@kernel.org>,
<hramamurthy@google.com>, <ioana.ciornei@nxp.com>,
<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<luosifu@huawei.com>, <maxime.chevallier@bootlin.com>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>,
<shijing34@huawei.com>, <tengpeisen@huawei.com>,
<wudi234@huawei.com>, <wulike1@huawei.com>,
<zhengjiezhen@h-partners.com>, <zhoushuai28@huawei.com>
Subject: Re: [PATCH net-next v12 2/8] hinic3: Fix loose success check in rx buffer filling
Date: Mon, 3 Aug 2026 16:13:14 -0700 [thread overview]
Message-ID: <20260803161314.6d173920@kernel.org> (raw)
In-Reply-To: <20260729074450.909-1-gongfan1@huawei.com>
On Wed, 29 Jul 2026 15:44:50 +0800 Fan Gong wrote:
> > > diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c b/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c
> > > index 309ab5901379..389b1c2158be 100644
> > > --- a/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c
> > > +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c
> > > @@ -541,7 +541,7 @@ int hinic3_configure_rxqs(struct net_device *netdev, u16 num_rq,
> > > rq_associate_cqes(rxq);
> > >
> > > pkts = hinic3_rx_fill_buffers(rxq);
> > > - if (!pkts) {
> > > + if (pkts < rxq->q_mask) {
> > > netdev_err(netdev, "Failed to fill Rx buffer\n");
> > > return -ENOMEM;
> > > }
> >
> > Given the subject, curious if a partially populated ring result in any
> > functional failure? if so, then perhaps failure mode can be explained
> > and this specific change be sent to net tree?
>
> Thanks for the comment. It fixes a previous review comment of the patchset
> as the following quotes. To see the full review, visit
> https://lore.kernel.org/netdev/20260413171817.1e1eca30@kernel.org/
You misunderstood the comment there.
The concern was not about this function.
The concern is that hinic3_change_channel_settings() in the proposed
patch may fail after already tearing down the old configuration.
Driver should allocate memory and other resources for the queue
_before_ freeing the old memory. This limits the downtime and prevents
failed reconfiguration from bringing the device down.
IOW, when I said "this function may fail" I meant that you can't call
function which may fail after stopping the device and freeing mem.
Not that there is anything wrong with the function failing as it does..
next prev parent reply other threads:[~2026-08-03 23:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 6:54 [PATCH net-next v12 0/8] net: hinic3: PF initialization Fan Gong
2026-07-27 6:54 ` [PATCH net-next v12 1/8] hinic3: Fix drop skb when skb_checksum_help() fails Fan Gong
2026-07-30 11:30 ` Larysa Zaremba
2026-08-05 2:15 ` Fan Gong
2026-08-03 23:07 ` Jakub Kicinski
2026-08-05 2:30 ` Re: [PATCH net-next v12 1/8] hinic3: Fix drop skb when Fan Gong
2026-07-27 6:54 ` [PATCH net-next v12 2/8] hinic3: Fix loose success check in rx buffer filling Fan Gong
2026-07-27 16:37 ` Mohsin Bashir
2026-07-29 7:44 ` Fan Gong
2026-08-03 23:13 ` Jakub Kicinski [this message]
2026-08-05 2:22 ` Fan Gong
2026-07-27 6:54 ` [PATCH net-next v12 3/8] hinic3: Refactor channel state machine for dynamic queue configuration Fan Gong
2026-07-27 6:54 ` [PATCH net-next v12 4/8] hinic3: Add ethtool queue ops Fan Gong
2026-07-27 6:54 ` [PATCH net-next v12 5/8] hinic3: Add ethtool statistic ops Fan Gong
2026-07-27 6:54 ` [PATCH net-next v12 6/8] hinic3: Add ethtool coalesce ops Fan Gong
2026-07-27 6:54 ` [PATCH net-next v12 7/8] hinic3: Add ethtool rss ops Fan Gong
2026-07-27 6:54 ` [PATCH net-next v12 8/8] hinic3: Remove unneeded coalesce parameters 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=20260803161314.6d173920@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=august.hewei@huawei.com \
--cc=chenanwen@huawei.com \
--cc=davem@davemloft.net \
--cc=dimitri.daskalakis1@gmail.com \
--cc=edumazet@google.com \
--cc=gongfan1@huawei.com \
--cc=guoxin09@huawei.com \
--cc=horms@kernel.org \
--cc=hramamurthy@google.com \
--cc=ioana.ciornei@nxp.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luosifu@huawei.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mohsin.bashr@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shijing34@huawei.com \
--cc=tengpeisen@huawei.com \
--cc=wudi234@huawei.com \
--cc=wulike1@huawei.com \
--cc=zhengjiezhen@h-partners.com \
--cc=zhoushuai28@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