From: sashiko-bot@kernel.org
To: "Suraj Gupta" <suraj.gupta2@amd.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v4 1/6] net: xilinx: axienet: Introduce axienet_config for MAC-specific ops
Date: Wed, 07 Oct 2026 11:07:50 +0000 [thread overview]
Message-ID: <sashiko-outbox-162909@kernel.org> (raw)
In-Reply-To: <20261006110550.1990213-2-suraj.gupta2@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] net: axienet: jumbo capability flag is ignored in MTU configuration
--
commit 865179930c894853c80ee8475041f18d377414d1
Author: Suraj Gupta <suraj.gupta2@amd.com>
net: xilinx: axienet: Introduce axienet_config for MAC-specific ops
Introduce an axienet_config structure to abstract MAC-type-specific
operations, preparing the driver for supporting additional MAC types
beyond the existing 1G Ethernet.
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index ae8ed4495ea0e..5af48d5cbed3b 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
[ ... ]
> @@ -711,19 +744,23 @@ static void axienet_dma_stop(struct axienet_local *lp)
> */
> static int axienet_device_reset(struct net_device *ndev)
> {
> - u32 axienet_status;
> struct axienet_local *lp = netdev_priv(ndev);
> int ret;
>
> + if (lp->axienet_config->gt_reset)
> + lp->axienet_config->gt_reset(lp);
> +
> lp->max_frm_size = XAE_MAX_VLAN_FRAME_SIZE;
> - lp->options |= XAE_OPTION_VLAN;
> +
> + if (lp->axienet_config->vlan)
> + lp->options |= XAE_OPTION_VLAN;
> lp->options &= (~XAE_OPTION_JUMBO);
>
> if (ndev->mtu > XAE_MTU && ndev->mtu <= XAE_JUMBO_MTU) {
> lp->max_frm_size = ndev->mtu + VLAN_ETH_HLEN +
> XAE_TRL_SIZE;
>
> - if (lp->max_frm_size <= lp->rxmem)
> + if (lp->max_frm_size <= lp->rxmem && lp->axienet_config->jumbo)
> lp->options |= XAE_OPTION_JUMBO;
> }
[Severity: Medium]
Does this code silently drop large frames if a MAC configuration declares
jumbo = false?
Since axienet_probe() unconditionally sets ndev->max_mtu = XAE_JUMBO_MTU and
axienet_change_mtu() only validates lp->rxmem:
drivers/net/ethernet/xilinx/xilinx_axienet_main.c:axienet_change_mtu() {
...
if ((new_mtu + VLAN_ETH_HLEN +
XAE_TRL_SIZE) > lp->rxmem)
return -EINVAL;
WRITE_ONCE(ndev->mtu, new_mtu);
...
}
The network stack and DMA engine will allow MTUs up to 9000 bytes. However,
when the interface is brought up, axienet_device_reset() will now check
lp->axienet_config->jumbo and refuse to set XAE_OPTION_JUMBO on the hardware.
If an administrator runs `ip link set ethX mtu 9000` on an interface that
does not support jumbo frames, shouldn't axienet_probe() or
axienet_change_mtu() reject the configuration instead of allowing the stack
to send jumbo frames that the hardware will drop?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261006110550.1990213-1-suraj.gupta2@amd.com?part=1
next prev parent reply other threads:[~2026-10-07 11:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 11:05 [PATCH net-next v4 0/6] net: xilinx: axienet: Add 10G/25G (XXV) ethernet support Suraj Gupta
2026-10-06 11:05 ` [PATCH net-next v4 1/6] net: xilinx: axienet: Introduce axienet_config for MAC-specific ops Suraj Gupta
2026-10-07 11:07 ` sashiko-bot [this message]
2026-10-06 11:05 ` [PATCH net-next v4 2/6] dt-bindings: net: xlnx,xxv-ethernet: Add Xilinx XXV 10G/25G Ethernet Suraj Gupta
2026-10-06 11:05 ` [PATCH net-next v4 3/6] net: xilinx: axienet: Add 10G/25G (XXV) ethernet support Suraj Gupta
2026-10-06 11:05 ` [PATCH net-next v4 4/6] net: xilinx: axienet: Make axienet_rmon_ranges non-static for reuse Suraj Gupta
2026-10-06 11:05 ` [PATCH net-next v4 5/6] net: xilinx: axienet: Dispatch statistics through axienet_config ops Suraj Gupta
2026-10-06 11:05 ` [PATCH net-next v4 6/6] net: xilinx: axienet: Add statistics support for XXV ethernet Suraj Gupta
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=sashiko-outbox-162909@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=suraj.gupta2@amd.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