From: netdev-bot+sashiko@kernel.org
To: gongfan1@huawei.com
Cc: wudi234@huawei.com, tengpeisen@huawei.com,
netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
andrew+netdev@lunn.ch, ioana.ciornei@nxp.com,
maxime.chevallier@bootlin.com, mohsin.bashr@gmail.com,
dimitri.daskalakis1@gmail.com, hramamurthy@google.com,
larysa.zaremba@intel.com, vadim.fedorenko@linux.dev,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
zhoushuai28@huawei.com, wulike1@huawei.com
Subject: Re: [PATCH net-next v03 1/4] hinic3: Solve an stall issue in hinic3_rx_poll()
Date: Mon, 16 Nov 2026 13:51:00 +0000 [thread overview]
Message-ID: <179483706058.3136.10285830784203129885@kernel.org> (raw)
In-Reply-To: <8d5247fdc88d6a2db6340da79eb9b64f3cdd20e0.1794467919.git.gongfan1@huawei.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The fix does not cover the case where the RX refill fails, so
the RQ can still stall.
--
hinic3: Solve an stall issue in hinic3_rx_poll()
This patch makes hinic3_rx_poll() return the full budget in two cases:
recv_one_pkt() fails, or the LRO replenish threshold is reached. In both
cases NAPI keeps polling instead of completing and re-enabling the
interrupt while unprocessed CQEs or depleted WQEs remain.
> diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c b/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c
> index 309ab59013797..f2262cdd66287 100644
> --- a/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c
> +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c
[ ... ]
> @@ -581,12 +584,14 @@ int hinic3_rx_poll(struct hinic3_rxq *rxq, int budget)
>
> rx_cqe->status = 0;
>
> - if (num_wqe >= nic_dev->lro_replenish_thld)
> + if (num_wqe >= nic_dev->lro_replenish_thld) {
> + poll_again = true;
> break;
> + }
> }
>
> if (rxq->delta >= HINIC3_RX_BUFFER_WRITE)
> hinic3_rx_fill_buffers(rxq);
>
> - return nr_pkts;
> + return poll_again ? budget : nr_pkts;
[Severity: High]
Can the RQ still stall when the refill itself fails? The return value of
hinic3_rx_fill_buffers() is ignored here, and poll_again is not set when
fewer WQEs than needed get posted.
hinic3_rx_fill_buffers() stops at the first page_pool allocation failure.
If that happens on the very first WQE, it rings no doorbell at all:
drivers/net/ethernet/huawei/hinic3/hinic3_rx.c:hinic3_rx_fill_buffers() {
...
for (i = 0; i < free_wqebbs; i++) {
...
err = rx_alloc_mapped_page(rxq->page_pool, rx_info,
rxq->buf_len);
if (unlikely(err))
break;
...
}
if (likely(i)) {
hinic3_write_db(rxq->rq, rxq->q_id & 3, DB_CFLAG_DP_RQ,
rxq->next_to_update << HINIC3_NORMAL_RQ_WQE);
...
}
Under memory pressure, refills can fail across several polls while
hinic3_fetch_rx_buffer() keeps adding sge_num to rxq->delta for each
consumed packet. Large LRO frames, which use up to 16 WQEs each, drain the
posted WQEs quickly.
On the last such poll the loop drains all CQEs and exits on !RXDONE. The
refill fails again, and hinic3_rx_poll() returns nr_pkts < budget. Then
hinic3_poll() does this:
drivers/net/ethernet/huawei/hinic3/hinic3_irq.c:hinic3_poll() {
...
if (likely(napi_complete_done(napi, work_done))) {
hinic3_net_dim(nic_dev, irq_cfg);
hinic3_set_msix_state(nic_dev->hwdev, irq_cfg->msix_entry_idx,
HINIC3_MSIX_ENABLE);
...
}
As the commit message says, the chip drops packets when it has no WQEs, so
no CQE is written and no RX interrupt is raised. qp_irq() is the only
napi_schedule() caller in the driver. hinic3_rx_fill_buffers() is called
only from hinic3_configure_rxqs() and hinic3_rx_poll(), and the periodic
work does not refill RX buffers.
Wouldn't the queue then stay dead even after memory frees up, until the
interface is reconfigured? That looks like the same "WQEs cannot be
replenished in time ... the NAPI instance will not be polled again"
failure, reached through the refill allocation failure path.
Would it make sense to also set poll_again when hinic3_rx_fill_buffers()
posts fewer WQEs than requested? Several other drivers do this; i40e, for
example, does "return failure ? budget : total_rx_packets". A deferred
refill would be another option. The later patches in this series don't
seem to touch hinic3_rx.c, so this case still looks open at the end of
the series.
> }
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794467919.git.gongfan1%40huawei.com
next prev parent reply other threads:[~2026-11-16 13:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 7:06 [PATCH net-next v03 0/4] net: hinic3: Bugfix for later patch-set Fan Gong
2026-11-12 7:06 ` [PATCH net-next v03 1/4] hinic3: Solve an stall issue in hinic3_rx_poll() Fan Gong
2026-11-16 13:51 ` netdev-bot+sashiko [this message]
2026-11-12 7:06 ` [PATCH net-next v03 2/4] hinic3: Avoid concurrent updates on 32-bit systems Fan Gong
2026-11-16 13:51 ` netdev-bot+sashiko
2026-11-12 7:06 ` [PATCH net-next v03 3/4] hinic3: fix some checkpatchs Fan Gong
2026-11-12 7:06 ` [PATCH net-next v03 4/4] hinic3: Ensure that the value of max_qps is not changed Fan Gong
2026-11-16 13:51 ` netdev-bot+sashiko
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=179483706058.3136.10285830784203129885@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dimitri.daskalakis1@gmail.com \
--cc=edumazet@google.com \
--cc=gongfan1@huawei.com \
--cc=horms@kernel.org \
--cc=hramamurthy@google.com \
--cc=ioana.ciornei@nxp.com \
--cc=kuba@kernel.org \
--cc=larysa.zaremba@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=mohsin.bashr@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tengpeisen@huawei.com \
--cc=vadim.fedorenko@linux.dev \
--cc=wudi234@huawei.com \
--cc=wulike1@huawei.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
all inboxes | Powered by JetHome®