From: "Lange Tang" <lange_tang@163.com>
To: "mst@redhat.com" <mst@redhat.com>
Cc: "Jakub Kicinski" <kuba@kernel.org>,
"Eugenio Perez" <eperezma@redhat.com>,
"jasowangio@gmail.com" <jasowangio@gmail.com>,
"xuanzhuo@linux.alibaba.com" <xuanzhuo@linux.alibaba.com>,
"virtualization@lists.linux.dev" <virtualization@lists.linux.dev>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"Tang Longjun" <tanglongjun@kylinos.cn>
Subject: Re:Re: [PATCH 3/3] virtio_net: add rx_timeouts per-queue statistic
Date: Fri, 20 Nov 2026 15:15:29 +0800 (CST) [thread overview]
Message-ID: <f2f9771.5acd.1a1f7cf6f72.Coremail.lange_tang@163.com> (raw)
In-Reply-To: <20261112175235-mutt-send-email-mst@kernel.org>
At 2026-11-13 06:52:53, "Michael S. Tsirkin" <mst@redhat.com> wrote:
>On Mon, Nov 09, 2026 at 05:43:10PM +0800, Longjun Tang wrote:
>> From: Longjun Tang <tanglongjun@kylinos.cn>
>>
>> Add an rx_timeouts field to the per-queue RX statistics and expose it
>> via ethtool. Whenever an RX queue gets stuck, the NAPI poll increments
>> rx_timeouts, so it counts RX queue stuck events.
>>
>> Signed-off-by: Longjun Tang <tanglongjun@kylinos.cn>
>> ---
>> drivers/net/virtio_net.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>> index ec7c248080c5..feb6bfbb1c5a 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -135,6 +135,7 @@ struct virtnet_rq_stats {
>> u64_stats_t xdp_redirects;
>> u64_stats_t xdp_drops;
>> u64_stats_t kicks;
>> + u64_stats_t rx_timeouts;
>> };
>>
>> #define VIRTNET_SQ_STAT(name, m) {name, offsetof(struct virtnet_sq_stats, m), -1}
>> @@ -168,6 +169,7 @@ static const struct virtnet_stat_desc virtnet_rq_stats_desc[] = {
>> VIRTNET_RQ_STAT("xdp_redirects", xdp_redirects),
>> VIRTNET_RQ_STAT("xdp_drops", xdp_drops),
>> VIRTNET_RQ_STAT("kicks", kicks),
>> + VIRTNET_RQ_STAT("rx_timeouts", rx_timeouts),
>> };
>>
>
>Is this consistent with any other hardware?
Renamed to stalls in v2. No other HW exposes this exact counter; it counts driver-detected
RX stalls.
>
>> static const struct virtnet_stat_desc virtnet_sq_stats_desc_qstat[] = {
>> @@ -2983,6 +2985,12 @@ static int virtnet_receive(struct receive_queue *rq, int budget,
>> u64_stats_add(item, u64_stats_read(src));
>> }
>>
>> + /* Count a stall recovered by this poll. */
>> + if (rq->watchdog.stalled) {
>> + u64_stats_inc(&rq->stats.rx_timeouts);
>> + rq->watchdog.stalled = false;
>> + }
>> +
>> u64_stats_add(&rq->stats.packets, u64_stats_read(&stats.packets));
>> u64_stats_add(&rq->stats.bytes, u64_stats_read(&stats.bytes));
>> u64_stats_add(&rq->stats.alloc_fail, u64_stats_read(&stats.alloc_fail));
>> --
>> 2.51.0
prev parent reply other threads:[~2026-11-20 7:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 9:43 [PATCH 0/3] virtio_net: introduce an RX queue watchdog for stuck detection Longjun Tang
2026-11-09 9:43 ` [PATCH 1/3] virtio: add virtqueue_get_last_used_idx() helper Longjun Tang
2026-11-12 16:51 ` Jakub Kicinski
2026-11-20 7:10 ` Lange Tang
2026-11-12 22:50 ` Michael S. Tsirkin
2026-11-20 7:13 ` Lange Tang
2026-11-09 9:43 ` [PATCH 2/3] virtio_net: introduce an RX queue watchdog for stuck detection Longjun Tang
2026-11-12 16:53 ` Jakub Kicinski
2026-11-20 7:11 ` Lange Tang
2026-11-12 22:51 ` Michael S. Tsirkin
2026-11-20 7:14 ` Lange Tang
2026-11-09 9:43 ` [PATCH 3/3] virtio_net: add rx_timeouts per-queue statistic Longjun Tang
2026-11-12 22:52 ` Michael S. Tsirkin
2026-11-20 7:15 ` Lange Tang [this message]
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=f2f9771.5acd.1a1f7cf6f72.Coremail.lange_tang@163.com \
--to=lange_tang@163.com \
--cc=eperezma@redhat.com \
--cc=jasowangio@gmail.com \
--cc=kuba@kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=tanglongjun@kylinos.cn \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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