Netdev List
 help / color / mirror / Atom feed
* [PATCH iwl-net] idpf: report Rx overflow and length drops again
@ 2026-11-26  2:34 Soheil Hassas Yeganeh (Anthropic)
  2026-11-26  5:25 ` Przemek Kitszel
  0 siblings, 1 reply; 2+ messages in thread
From: Soheil Hassas Yeganeh (Anthropic) @ 2026-11-26  2:34 UTC (permalink / raw)
  To: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alan Brady
  Cc: intel-wired-lan, netdev, Soheil Hassas Yeganeh (Anthropic)

Commit 43b67308df98 ("idpf: refactor remaining virtchnl messages")
started copying rx_errors from the VIRTCHNL2_OP_GET_STATS reply, but
stopped copying rx_overflow_drop and rx_invalid_frame_length. Since
v6.9, rx_over_errors and rx_length_errors are always 0.

Add them back. Leave rx_errors and rx_dropped as they are: virtchnl2.h
does not say whether the device already includes these drops in them.

Tested in a QEMU guest whose kernel was modified to carry a test-only
emulation of the device that sets both fields: the counters read 0
without this patch and the set values with it. Not tested on hardware,
and no selftests were run. A kprobe on one machine (x86_64, 6.18-based
kernel) showed both fields of the reply at 0, so we have not observed
a drop that went unreported.

Found by an LLM reading the stats code while we were debugging Rx loss
on machines in real use.

Fixes: 43b67308df98 ("idpf: refactor remaining virtchnl messages")
Signed-off-by: Soheil Hassas Yeganeh (Anthropic) <soheil.kdev@gmail.com>
---
An LLM-based coding assistant found the missing assignments, wrote the
fix and the changelog, and wrote and ran the QEMU test. Built with W=1,
the driver's directory only: x86_64 allmodconfig and allyesconfig, and
i386 allmodconfig. Not run on an idpf device, and no selftests were run.

This restores the v6.8 mapping. The same commit added rx_errors, so if
dropping these two was intended, please say so and I will resend for
iwl-next without the Fixes tag. If the device's overflow count means
"out of Rx buffers", rx_missed_errors may fit it better.

Based on net/main.
---
 drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
index c89783966bae..bdbfd3d4e545 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
@@ -2503,6 +2503,9 @@ int idpf_send_get_stats_msg(struct idpf_netdev_priv *np,
 	netstats->tx_errors = le64_to_cpu(stats_recv->tx_errors);
 	netstats->rx_dropped = le64_to_cpu(stats_recv->rx_discards);
 	netstats->tx_dropped = le64_to_cpu(stats_recv->tx_discards);
+	netstats->rx_length_errors =
+		le64_to_cpu(stats_recv->rx_invalid_frame_length);
+	netstats->rx_over_errors = le64_to_cpu(stats_recv->rx_overflow_drop);
 
 	port_stats->vport_stats = *stats_recv;
 

---
base-commit: ef3e21c61baa74e39a49b75318bd4541562ec43f
change-id: 20261126-b4-idpf-rx-drop-stats-7bb4eded6d49


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH iwl-net] idpf: report Rx overflow and length drops again
  2026-11-26  2:34 [PATCH iwl-net] idpf: report Rx overflow and length drops again Soheil Hassas Yeganeh (Anthropic)
@ 2026-11-26  5:25 ` Przemek Kitszel
  0 siblings, 0 replies; 2+ messages in thread
From: Przemek Kitszel @ 2026-11-26  5:25 UTC (permalink / raw)
  To: Soheil Hassas Yeganeh (Anthropic), Andrew Lunn, Eric Dumazet,
	Paolo Abeni
  Cc: intel-wired-lan, Tony Nguyen, David S. Miller, netdev,
	Jakub Kicinski

On 11/26/26 3:34 AM, Soheil Hassas Yeganeh (Anthropic) wrote:
> Commit 43b67308df98 ("idpf: refactor remaining virtchnl messages")
> started copying rx_errors from the VIRTCHNL2_OP_GET_STATS reply, but
> stopped copying rx_overflow_drop and rx_invalid_frame_length. Since
> v6.9, rx_over_errors and rx_length_errors are always 0.
> 
> Add them back. Leave rx_errors and rx_dropped as they are: virtchnl2.h
> does not say whether the device already includes these drops in them.
> 
> Tested in a QEMU guest whose kernel was modified to carry a test-only
> emulation of the device that sets both fields: the counters read 0
> without this patch and the set values with it. Not tested on hardware,
> and no selftests were run. A kprobe on one machine (x86_64, 6.18-based
> kernel) showed both fields of the reply at 0, so we have not observed
> a drop that went unreported.
> 
> Found by an LLM reading the stats code while we were debugging Rx loss
> on machines in real use.
> 
> Fixes: 43b67308df98 ("idpf: refactor remaining virtchnl messages")
> Signed-off-by: Soheil Hassas Yeganeh (Anthropic) <soheil.kdev@gmail.com>

This is indeed adhering to the spec, per comment above struct
rtnl_link_stats64. And you have correctly picked offending commit.
There is also almost no risk, as you only bring back two specialized
error counters, leaving the total rx err counter as is.

Acked-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>

> ---
> An LLM-based coding assistant found the missing assignments, wrote the
> fix and the changelog, and wrote and ran the QEMU test. Built with W=1,
> the driver's directory only: x86_64 allmodconfig and allyesconfig, and
> i386 allmodconfig. Not run on an idpf device, and no selftests were run.
> 
> This restores the v6.8 mapping. The same commit added rx_errors, so if
> dropping these two was intended, please say so and I will resend for
> iwl-next without the Fixes tag. If the device's overflow count means
> "out of Rx buffers", rx_missed_errors may fit it better.
> 
> Based on net/main.
> ---
>   drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
> index c89783966bae..bdbfd3d4e545 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
> +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
> @@ -2503,6 +2503,9 @@ int idpf_send_get_stats_msg(struct idpf_netdev_priv *np,
>   	netstats->tx_errors = le64_to_cpu(stats_recv->tx_errors);
>   	netstats->rx_dropped = le64_to_cpu(stats_recv->rx_discards);
>   	netstats->tx_dropped = le64_to_cpu(stats_recv->tx_discards);
> +	netstats->rx_length_errors =
> +		le64_to_cpu(stats_recv->rx_invalid_frame_length);
> +	netstats->rx_over_errors = le64_to_cpu(stats_recv->rx_overflow_drop);
>   
>   	port_stats->vport_stats = *stats_recv;
>   
> 
> ---
> base-commit: ef3e21c61baa74e39a49b75318bd4541562ec43f
> change-id: 20261126-b4-idpf-rx-drop-stats-7bb4eded6d49
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-26  5:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26  2:34 [PATCH iwl-net] idpf: report Rx overflow and length drops again Soheil Hassas Yeganeh (Anthropic)
2026-11-26  5:25 ` Przemek Kitszel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox