Devicetree
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: Selvamani.Rajagopal@onsemi.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, parthiban.veerasooran@microchip.com,
	horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org,
	rdunlap@infradead.org, richardcochran@gmail.com, andrew@lunn.ch,
	hkallweit1@gmail.com, linux@armlinux.org.uk, edumazet@kernel.org,
	piergiorgio.beruto@gmail.com, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, jerry.ray@microchip.com,
	ciprian.regus@analog.com
Subject: Re: [PATCH net-next v11 08/14] net: ethernet: oa_tc6: Drop frames if footer has FD bit set
Date: Tue, 17 Nov 2026 19:53:04 +0000	[thread overview]
Message-ID: <179494518411.3136.11012925273881298159@kernel.org> (raw)
In-Reply-To: <20261113-s2500-mac-phy-support-v11-8-7a186141952c@onsemi.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

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).

- [Medium] In oa_tc6_prcs_rx_chunk_payload()
  (drivers/net/ethernet/oa_tc6/oa_tc6_main.c), frames the MAC-PHY marks…
- [Low] This concern is retained only because it requires validation.

--

net: ethernet: oa_tc6: Drop frames if footer has FD bit set

This patch adds handling for the Frame Drop (FD) bit in the receive data
chunk footer in oa_tc6_prcs_rx_chunk_payload(). When the last chunk of a
frame has FD set, any partially assembled rx_skb is freed and the dropped
frame's data is skipped. If the same chunk also carries the start of a
new frame, that new frame is still processed.

> diff --git a/drivers/net/ethernet/oa_tc6/oa_tc6_main.c b/drivers/net/ethernet/oa_tc6/oa_tc6_main.c
> index 2b31370da2d2b..5d01ef5a13ad0 100644
> --- a/drivers/net/ethernet/oa_tc6/oa_tc6_main.c
> +++ b/drivers/net/ethernet/oa_tc6/oa_tc6_main.c

[ ... ]

> @@ -1159,6 +1160,25 @@ static int oa_tc6_prcs_rx_chunk_payload(struct oa_tc6 *tc6, u8 *data,
>  	if (tc6->wait_until_start_valid)
>  		return 0;
>  
> +	/* Drop the frame, if footer sets FD bit. Checking FD bit
> +	 * becomes important, when cut-through operation is enabled.
> +	 */

[Severity: Low]
The only scenario the commit message gives for FD being set is RX
cut-through:

  With RX cut-through enabled, the MAC-PHY can start forwarding a frame
  before it knows the frame is bad, and uses FD to tell the host to
  discard it.

At this commit nothing enables cut-through. struct oa_tc6 has no
cut-through state yet, and nothing writes OA_TC6_CONFIG0_RXCTE.

The later S2500 patch in this series adds ctc_capable,
oa_tc6_rx_cut_through_enable() and the OA_TC6_CONFIG_RX_CUT_THROUGH
quirk. That makes this patch groundwork for that change, and the ordering
looks fine.

Can the existing MAC-PHYs (LAN865x and others) also set FD in their
default store-and-forward mode? If so, frames marked FD would currently
reach the stack through oa_tc6_submit_rx_skb()->netif_rx(). Should this
then carry a Fixes: tag? If not, could the commit message say that
cut-through is enabled by a later patch in the series?

> +	if (end_valid && frame_drop) {
> +		oa_tc6_cleanup_ongoing_rx_skb(tc6);
> +
> +		/* Full frame in this chunk. Nothing to free. Move on to
> +		 * next chunk.
> +		 */
> +		if (start_valid && start_byte_offset < end_byte_offset) {
> +			tc6->netdev->stats.rx_dropped++;
> +			return 0;
> +		}

[Severity: Medium]
Should frames with FD set be counted in rx_errors rather than only in
rx_dropped?

For a frame that fits in one chunk, this block increments only
rx_dropped. For a frame that spans several chunks, the
oa_tc6_cleanup_ongoing_rx_skb() call above also increments only
rx_dropped:

static void oa_tc6_cleanup_ongoing_rx_skb(struct oa_tc6 *tc6)
{
	if (tc6->rx_skb) {
		tc6->netdev->stats.rx_dropped++;
		kfree_skb(tc6->rx_skb);
		tc6->rx_skb = NULL;
	}
}

The kernel-doc for struct rtnl_link_stats64 in
include/uapi/linux/if_link.h defines these counters as follows:

  @rx_errors: Total number of bad packets received on this network device.
  @rx_dropped: Number of packets received but not processed,
    e.g. due to lack of resources or unsupported protocol.

The commit message describes FD frames as frames the MAC-PHY "knows the
frame is bad". These are bad frames from the wire, not host-side drops.

With cut-through enabled on S2500 later in the series, would every
corrupted frame on the segment show up as rx_dropped in ip -s link while
rx_errors stays at 0?

> +
> +		/* The chunk carries only the end of the dropped frame. */
> +		if (!start_valid)
> +			return 0;
> +	}
> +

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113-s2500-mac-phy-support-v11-0-7a186141952c%40onsemi.com

  reply	other threads:[~2026-11-17 19:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 16:59 [PATCH net-next v11 00/14] (no cover subject) Selvamani Rajagopal via B4 Relay
2026-11-13 16:59 ` [PATCH net-next v11 01/14] dt-bindings: net: add onsemi's S2500 Selvamani Rajagopal via B4 Relay
2026-11-13 16:59 ` [PATCH net-next v11 02/14] Documentation: networking: Add timestamp related APIs to OA TC6 framework Selvamani Rajagopal via B4 Relay
2026-11-13 16:59 ` [PATCH net-next v11 03/14] net: ethernet: oa_tc6: Move oa_tc6.c to its own directory Selvamani Rajagopal via B4 Relay
2026-11-17 19:52   ` netdev-bot+sashiko
2026-11-13 16:59 ` [PATCH net-next v11 04/14] net: ethernet: oa_tc6: Move constant definitions to header file Selvamani Rajagopal via B4 Relay
2026-11-13 16:59 ` [PATCH net-next v11 05/14] net: ethernet: microchip: lan865x: Depends on PTP_1588_CLOCK_OPTIONAL Selvamani Rajagopal via B4 Relay
2026-11-17 19:53   ` netdev-bot+sashiko
2026-11-13 16:59 ` [PATCH net-next v11 06/14] net: ethernet: adi: adin1140: " Selvamani Rajagopal via B4 Relay
2026-11-13 16:59 ` [PATCH net-next v11 07/14] net: ethernet: oa_tc6: Support for hardware timestamp Selvamani Rajagopal via B4 Relay
2026-11-14 16:59   ` sashiko-bot
2026-11-17 19:53   ` netdev-bot+sashiko
2026-11-13 16:59 ` [PATCH net-next v11 08/14] net: ethernet: oa_tc6: Drop frames if footer has FD bit set Selvamani Rajagopal via B4 Relay
2026-11-17 19:53   ` netdev-bot+sashiko [this message]
2026-11-13 16:59 ` [PATCH net-next v11 09/14] net: phy: ncn26000: Enable enhanced noise immunity Selvamani Rajagopal via B4 Relay
2026-11-13 16:59 ` [PATCH net-next v11 10/14] net: ethernet: onsemi: s2500: Add driver support for S2500 Selvamani Rajagopal via B4 Relay
2026-11-14 16:59   ` sashiko-bot
2026-11-16 22:34   ` Selvamani Rajagopal
2026-11-17  1:44     ` Andrew Lunn
2026-11-17  1:54       ` Selvamani Rajagopal
2026-11-17 19:53   ` netdev-bot+sashiko
2026-11-13 16:59 ` [PATCH net-next v11 11/14] net: ethernet: onsemi: s2500: Add selftest support Selvamani Rajagopal via B4 Relay
2026-11-13 16:59 ` [PATCH net-next v11 12/14] net: phy: Add helper to modify only the PHY loopback bit Selvamani Rajagopal via B4 Relay
2026-11-13 16:59 ` [PATCH net-next v11 13/14] net: phy: ncn26000: Support for onsemi's S2500 internal phy Selvamani Rajagopal via B4 Relay
2026-11-17 19:53   ` netdev-bot+sashiko
2026-11-13 16:59 ` [PATCH net-next v11 14/14] net: phy: dp83867: Use genphy_loopback_no_speed() Selvamani Rajagopal via B4 Relay

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=179494518411.3136.11012925273881298159@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=Selvamani.Rajagopal@onsemi.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=ciprian.regus@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=jerry.ray@microchip.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=parthiban.veerasooran@microchip.com \
    --cc=piergiorgio.beruto@gmail.com \
    --cc=rdunlap@infradead.org \
    --cc=richardcochran@gmail.com \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /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