From: sashiko-bot@kernel.org
To: "Daniel Machon" <daniel.machon@microchip.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next v7 10/14] net: lan966x: add PCIe FDMA support
Date: Sat, 19 Sep 2026 11:35:30 +0000 [thread overview]
Message-ID: <20260919113531.4EFC81F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260918-lan966x-pci-fdma-v7-10-0ecc179c8a2c@microchip.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] net: lan966x: rx_bytes statistic undercounts received frame size
--
commit 33bf15bc7637a43a47c2a31af68430d11cdb1f96
Author: Daniel Machon <daniel.machon@microchip.com>
net: lan966x: add PCIe FDMA support
Add PCIe FDMA support for lan966x. The PCIe FDMA path uses contiguous
DMA buffers mapped through the endpoint's ATU, with memcpy-based frame
transfer instead of per-page DMA mappings.
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma_pci.c b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma_pci.c
> new file mode 100644
> index 0000000000000..5d6902459f200
> --- /dev/null
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma_pci.c
[ ... ]
> +static struct sk_buff *lan966x_fdma_pci_rx_get_frame(struct lan966x_rx *rx,
> + u64 src_port)
> +{
[ ... ]
> + skb->protocol = eth_type_trans(skb, skb->dev);
> +
> + if (lan966x->bridge_mask & BIT(src_port)) {
> + skb->offload_fwd_mark = 1;
> +
> + skb_reset_network_header(skb);
> + if (!lan966x_hw_offload(lan966x, src_port, skb))
> + skb->offload_fwd_mark = 0;
> + }
> +
> + skb->dev->stats.rx_bytes += skb->len;
[Severity: Medium]
Does this regression undercount the received frame size for the rx_bytes
statistic?
In lan966x_fdma_pci_rx_get_frame(), eth_type_trans() inherently pulls the
Ethernet header from the SKB, reducing skb->len. Additionally, if
lan966x_hw_offload() optionally calls skb_vlan_untag(), it further reduces
the length.
Adding this modified, smaller skb->len to the rx_bytes counter instead of
the original wire length causes the statistic to systematically undercount
received bytes by at least 14 bytes (the MAC header size) per packet, and
potentially more if VLAN tags are present.
Although this pattern may have been copied from the existing non-PCI path,
it is a newly introduced instance in this file. A check of the subsequent
patches in this series reveals the problem remains unfixed in the final state
of the series (commit f075590a2768b1e0f139412f8b14c4b61658552e).
Could the original length be recorded for the statistic before the headers
are pulled?
> + skb->dev->stats.rx_packets++;
> +
> + return skb;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260918-lan966x-pci-fdma-v7-0-0ecc179c8a2c@microchip.com?part=10
next prev parent reply other threads:[~2026-09-19 11:35 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 11:33 [PATCH net-next v7 00/14] net: lan966x: add support for PCIe FDMA Daniel Machon
2026-09-18 11:33 ` [PATCH net-next v7 01/14] MAINTAINERS: add FDMA library to Sparx5 SoC entry Daniel Machon
2026-09-23 8:48 ` Simon Horman
2026-09-18 11:33 ` [PATCH net-next v7 02/14] net: microchip: fdma: rename contiguous dataptr helpers Daniel Machon
2026-09-23 8:49 ` Simon Horman
2026-09-18 11:33 ` [PATCH net-next v7 03/14] net: microchip: fdma: add PCIe ATU support Daniel Machon
2026-09-22 13:00 ` netdev-bot+sashiko
2026-09-23 6:35 ` Daniel Machon
2026-09-23 8:51 ` Simon Horman
2026-09-18 11:33 ` [PATCH net-next v7 04/14] net: lan966x: add FDMA LLP register write helper Daniel Machon
2026-09-22 13:00 ` netdev-bot+sashiko
2026-09-23 7:07 ` Daniel Machon
2026-09-23 8:54 ` Simon Horman
2026-09-18 11:33 ` [PATCH net-next v7 05/14] net: lan966x: export FDMA helpers for reuse Daniel Machon
2026-09-23 8:57 ` Simon Horman
2026-09-18 11:33 ` [PATCH net-next v7 06/14] net: lan966x: use a dedicated device for DMA operations Daniel Machon
2026-09-23 8:59 ` Simon Horman
2026-09-18 11:33 ` [PATCH net-next v7 07/14] net: lan966x: add FDMA ops dispatch for PCIe support Daniel Machon
2026-09-23 9:00 ` Simon Horman
2026-09-18 11:34 ` [PATCH net-next v7 08/14] net: lan966x: clear FDMA interrupt stickies after switch reset Daniel Machon
2026-09-22 13:00 ` netdev-bot+sashiko
2026-09-23 9:01 ` Simon Horman
2026-09-18 11:34 ` [PATCH net-next v7 09/14] net: lan966x: add shutdown callback to stop the FDMA on reboot Daniel Machon
2026-09-22 13:00 ` netdev-bot+sashiko
2026-09-23 9:02 ` Simon Horman
2026-09-18 11:34 ` [PATCH net-next v7 10/14] net: lan966x: add PCIe FDMA support Daniel Machon
2026-09-19 11:35 ` sashiko-bot [this message]
2026-09-22 13:00 ` netdev-bot+sashiko
2026-09-23 8:45 ` Daniel Machon
2026-09-23 18:07 ` Simon Horman
2026-09-23 20:11 ` Daniel Machon
2026-09-24 6:46 ` Simon Horman
2026-09-24 15:31 ` Jakub Kicinski
2026-09-24 16:24 ` Daniel Machon
2026-09-18 11:34 ` [PATCH net-next v7 11/14] net: lan966x: add PCIe FDMA MTU change support Daniel Machon
2026-09-22 13:00 ` netdev-bot+sashiko
2026-09-23 9:46 ` Daniel Machon
2026-09-23 19:39 ` Simon Horman
2026-09-23 20:07 ` Daniel Machon
2026-09-24 6:43 ` Simon Horman
2026-09-18 11:34 ` [PATCH net-next v7 12/14] net: lan966x: add PCIe FDMA XDP support Daniel Machon
2026-09-22 13:00 ` netdev-bot+sashiko
2026-09-23 10:14 ` Daniel Machon
2026-09-24 6:53 ` Simon Horman
2026-09-18 11:34 ` [PATCH net-next v7 13/14] misc: lan966x-pci: dts: extend cpu reg to cover PCIE DBI space Daniel Machon
2026-09-22 13:00 ` netdev-bot+sashiko
2026-09-24 6:54 ` Simon Horman
2026-09-18 11:34 ` [PATCH net-next v7 14/14] misc: lan966x-pci: dts: add fdma interrupt to overlay Daniel Machon
2026-09-22 13:00 ` netdev-bot+sashiko
2026-09-24 6:54 ` Simon Horman
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=20260919113531.4EFC81F00898@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel.machon@microchip.com \
--cc=sashiko-reviews@lists.linux.dev \
/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