* [PATCH net-next v5] net: stmmac: dwxgmac2: enable L2 split header support
@ 2026-11-20 0:52 Sagar Cheluvegowda
2026-11-24 1:33 ` netdev-bot+sashiko
0 siblings, 1 reply; 2+ messages in thread
From: Sagar Cheluvegowda @ 2026-11-20 0:52 UTC (permalink / raw)
To: maxime.chevallier, andrew+netdev, davem, edumazet, kuba, pabeni,
mcoquelin.stm32, alexandre.torgue
Cc: netdev, linux-stm32, linux-arm-kernel, linux-arm-msm,
linux-kernel, lorenzo.bianconi, hongmei.xu, Abhishek Chauhan,
Sarosh Hasan, Sagar Cheluvegowda
When split header is enabled, XGMAC2 only splits IP packets that are
untagged or VLAN stripped, at the L3/L4 header boundary. Other packets,
such as tagged AV packets, can't use the split-header path.
Add a config_l2_split MAC callback for the MAC-global part of split
header and implement it for XGMAC2: select split at the L2 header offset
(SPLM = L2OFST) and enable Split AV (SAVE_EN) in XGMAC_EXT_CFG1,
extending the dwmac4 sequence added by commit d10f1a4e44c3 ("net:
stmmac: Programming sequence for VLAN packets with split header") to
XGMAC2. The databook states that L2 split is not supported for packets
with variable preamble, so also clear VPRE in XGMAC_EXT_CFG0 while L2
split is enabled.
The callback is called once, only on split header capable cores, and
reverts SPLM/SAVE_EN when split header is disabled, e.g. when RX
checksum offload is turned off. VPRE is left cleared, as it is reserved
on cores without variable preamble support. The callback is not
implemented for XLGMAC, which shares the XGMAC2 DMA ops but uses offset
0x140 for XLGMAC_RXQ_ENABLE_CTRL0.
Also make dwxgmac2_get_rx_header_len() follow the databook's "Header
Length Availability in RDES2" table: HL is only valid on the first
descriptor, and L34T is only valid on the last one. For non-IP packets
RDES2[1:0] carry AV status, so HL is RDES2[9:2].
Co-developed-by: Abhishek Chauhan <abhishek.chauhan@oss.qualcomm.com>
Signed-off-by: Abhishek Chauhan <abhishek.chauhan@oss.qualcomm.com>
Co-developed-by: Sarosh Hasan <sarosh.hasan@oss.qualcomm.com>
Signed-off-by: Sarosh Hasan <sarosh.hasan@oss.qualcomm.com>
Signed-off-by: Sagar Cheluvegowda <sagar.cheluvegowda@oss.qualcomm.com>
---
v5:
- Move the XGMAC_EXT_CFG0/EXT_CFG1 programming out of the DMA
enable_sph op into a new config_l2_split MAC op implemented only
for XGMAC2. The shared DMA op also ran on XLGMAC, where 0x140 is
XLGMAC_RXQ_ENABLE_CTRL0, and cleared the RX queue 4 enable bit
(Sashiko)
- Program it once instead of per RX channel, only when sph_capable,
and revert SPLM/SAVE_EN when split header is disabled (Sashiko)
- Clear the SPLM field before setting it (Sashiko)
- Describe the FD/LD handling as following the databook rather than
as a fix
- Fix line length warning
v4: https://lore.kernel.org/netdev/20261015221215.1714047-1-sagar.cheluvegowda@oss.qualcomm.com/
- Only read the header length on the first descriptor (FD=1)
v3: https://lore.kernel.org/netdev/20261013192759.776537-1-sagar.cheluvegowda@oss.qualcomm.com/
- Use zero-padded 0x00000140 for XGMAC_EXT_CFG0
v2: https://lore.kernel.org/netdev/20261007183905.2582759-1-sagar.cheluvegowda@oss.qualcomm.com/
- Add XGMAC_CONFIG1_SPLM_MASK and use it in XGMAC_CONFIG1_SPLM()
v1: https://lore.kernel.org/netdev/20260922232116.889630-1-sagar.cheluvegowda@oss.qualcomm.com/
.../net/ethernet/stmicro/stmmac/dwxgmac2.h | 9 +++++++++
.../ethernet/stmicro/stmmac/dwxgmac2_core.c | 20 +++++++++++++++++++
.../ethernet/stmicro/stmmac/dwxgmac2_descs.c | 16 ++++++++++++++-
drivers/net/ethernet/stmicro/stmmac/hwif.h | 4 ++++
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++++
5 files changed, 53 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
index f8ab347f7b5b..7f43a0b17083 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
@@ -167,6 +167,12 @@
#define XGMAC_HW_FEATURE4 0x0000012c
#define XGMAC_HWFEAT_EASP BIT(4)
#define XGMAC_HWFEAT_PCSEL GENMASK(1, 0)
+#define XGMAC_EXT_CFG0 0x00000140
+#define XGMAC_EXT_CFG0_VPRE BIT(8)
+#define XGMAC_EXT_CFG1 0x00000144
+#define XGMAC_CONFIG1_SAVE_EN BIT(24)
+#define XGMAC_CONFIG1_SPLM_MASK GENMASK(9, 8)
+#define XGMAC_CONFIG1_SPLM(v) FIELD_PREP(XGMAC_CONFIG1_SPLM_MASK, v)
#define XGMAC_MAC_DPP_FSM_INT_STATUS 0x00000150
#define XGMAC_MAC_FSM_CONTROL 0x00000158
#define XGMAC_PRTYEN BIT(1)
@@ -434,13 +440,16 @@
#define XGMAC_RDES2_L4FM BIT(28)
#define XGMAC_RDES2_L3FM BIT(27)
#define XGMAC_RDES2_HL GENMASK(9, 0)
+#define XGMAC_RDES2_NONIPHL GENMASK(9, 2)
#define XGMAC_RDES3_OWN BIT(31)
#define XGMAC_RDES3_CTXT BIT(30)
#define XGMAC_RDES3_IOC BIT(30)
+#define XGMAC_RDES3_FD BIT(29)
#define XGMAC_RDES3_LD BIT(28)
#define XGMAC_RDES3_CDA BIT(27)
#define XGMAC_RDES3_RSV BIT(26)
#define XGMAC_RDES3_L34T GENMASK(23, 20)
+#define XGMAC_RDES3_L2T GENMASK(19, 16)
#define XGMAC_RDES3_ET_LT GENMASK(19, 16)
#define XGMAC_L34T_IP4TCP 0x1
#define XGMAC_L34T_IP4UDP 0x2
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
index 09194b9d8322..58d7433e8b17 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
@@ -1412,6 +1412,25 @@ static int dwxgmac2_config_l4_filter(struct mac_device_info *hw, u32 filter_no,
return 0;
}
+static void dwxgmac2_config_l2_split(struct mac_device_info *hw, bool en)
+{
+ void __iomem *ioaddr = hw->pcsr;
+ u32 value;
+
+ /* L2 split is not supported for packets with variable preamble */
+ if (en) {
+ value = readl(ioaddr + XGMAC_EXT_CFG0);
+ value &= ~XGMAC_EXT_CFG0_VPRE;
+ writel(value, ioaddr + XGMAC_EXT_CFG0);
+ }
+
+ value = readl(ioaddr + XGMAC_EXT_CFG1);
+ value &= ~(XGMAC_CONFIG1_SPLM_MASK | XGMAC_CONFIG1_SAVE_EN);
+ if (en)
+ value |= XGMAC_CONFIG1_SPLM(1) | XGMAC_CONFIG1_SAVE_EN;
+ writel(value, ioaddr + XGMAC_EXT_CFG1);
+}
+
const struct stmmac_ops dwxgmac210_ops = {
.core_init = dwxgmac2_core_init,
.irq_modify = dwxgmac2_irq_modify,
@@ -1451,6 +1470,7 @@ const struct stmmac_ops dwxgmac210_ops = {
.config_l3_filter = dwxgmac2_config_l3_filter,
.config_l4_filter = dwxgmac2_config_l4_filter,
.fpe_map_preemption_class = dwxgmac3_fpe_map_preemption_class,
+ .config_l2_split = dwxgmac2_config_l2_split,
};
static void dwxlgmac2_rx_queue_enable(struct mac_device_info *hw, u8 mode,
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c
index 6719ac6e395b..b28aa39f9947 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c
@@ -292,8 +292,22 @@ static int dwxgmac2_get_rx_hash(struct dma_desc *p, u32 *hash,
static void dwxgmac2_get_rx_header_len(struct dma_desc *p, unsigned int *len)
{
- if (le32_to_cpu(p->des3) & XGMAC_RDES3_L34T)
+ u32 rdes3 = le32_to_cpu(p->des3);
+
+ /* HL is only defined on the first descriptor */
+ if (!(rdes3 & XGMAC_RDES3_FD))
+ return;
+
+ /* when FD=1 and LD=0, HL is RDES2[9:0] */
+ if (!(rdes3 & XGMAC_RDES3_LD)) {
+ *len = le32_to_cpu(p->des2) & XGMAC_RDES2_HL;
+ return;
+ }
+
+ if (rdes3 & XGMAC_RDES3_L34T)
*len = le32_to_cpu(p->des2) & XGMAC_RDES2_HL;
+ else if (rdes3 & XGMAC_RDES3_L2T)
+ *len = (le32_to_cpu(p->des2) & XGMAC_RDES2_NONIPHL) >> 2;
}
static void dwxgmac2_set_sec_addr(struct dma_desc *p, dma_addr_t addr, bool is_valid)
diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h
index 8ae95e91a36a..80131fdda2d5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/hwif.h
+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h
@@ -410,6 +410,8 @@ struct stmmac_ops {
int (*fpe_map_preemption_class)(struct net_device *ndev,
struct netlink_ext_ack *extack,
u32 pclass);
+ /* L2 header split, MAC-global part of split header */
+ void (*config_l2_split)(struct mac_device_info *hw, bool en);
};
#define stmmac_mac_pcs_init(__priv) \
@@ -492,6 +494,8 @@ struct stmmac_ops {
stmmac_do_callback(__priv, mac, config_l4_filter, __args)
#define stmmac_fpe_map_preemption_class(__priv, __args...) \
stmmac_do_callback(__priv, mac, fpe_map_preemption_class, __args)
+#define stmmac_config_l2_split(__priv, __args...) \
+ stmmac_do_void_callback(__priv, mac, config_l2_split, __args)
struct ptp_system_timestamp;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f256244ce0d1..0c333d14be4d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3832,6 +3832,8 @@ static int stmmac_hw_setup(struct net_device *dev)
/* Enable Split Header */
sph_en = (priv->hw->rx_csum > 0) && priv->sph_active;
+ if (priv->sph_capable)
+ stmmac_config_l2_split(priv, priv->hw, sph_en);
for (chan = 0; chan < rx_cnt; chan++)
stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan);
@@ -6467,6 +6469,7 @@ static int stmmac_set_features(struct net_device *netdev,
bool sph_en = (priv->hw->rx_csum > 0) && priv->sph_active;
u8 chan;
+ stmmac_config_l2_split(priv, priv->hw, sph_en);
for (chan = 0; chan < priv->plat->rx_queues_to_use; chan++)
stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan);
}
@@ -7430,6 +7433,8 @@ int stmmac_xdp_open(struct net_device *dev)
/* Adjust Split header */
sph_en = (priv->hw->rx_csum > 0) && priv->sph_active;
+ if (priv->sph_capable)
+ stmmac_config_l2_split(priv, priv->hw, sph_en);
/* DMA RX Channel Configuration */
for (chan = 0; chan < rx_cnt; chan++) {
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next v5] net: stmmac: dwxgmac2: enable L2 split header support
2026-11-20 0:52 [PATCH net-next v5] net: stmmac: dwxgmac2: enable L2 split header support Sagar Cheluvegowda
@ 2026-11-24 1:33 ` netdev-bot+sashiko
0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sashiko @ 2026-11-24 1:33 UTC (permalink / raw)
To: sagar.cheluvegowda
Cc: maxime.chevallier, andrew+netdev, davem, edumazet, kuba, pabeni,
mcoquelin.stm32, alexandre.torgue, netdev, linux-stm32,
linux-arm-kernel, linux-arm-msm, linux-kernel, lorenzo.bianconi,
hongmei.xu, abhishek.chauhan, sarosh.hasan
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 (1) · Medium: 3 · 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] The rewrite of dwxgmac2_get_rx_header_len() in
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c is shared by…
- [Medium] In dwxgmac2_get_rx_header_len()
(drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c), the header…
- [Medium] The new dwxgmac2_get_rx_header_len() reads the header length
in two different ways under the same SPLM=L2OFST + SAVE_EN…
- [Low] dwxgmac2_config_l2_split()
(drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c) sets SPLM =…
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the patch
extends it.
--
net: stmmac: dwxgmac2: enable L2 split header support
This adds a config_l2_split MAC callback and implements it for XGMAC2. On
enable it selects split at the L2 header offset, enables Split AV in
XGMAC_EXT_CFG1 and clears VPRE in XGMAC_EXT_CFG0. The callback is called
from stmmac_hw_setup(), stmmac_set_features() and stmmac_xdp_open() on split
header capable cores, and dwxgmac2_get_rx_header_len() is reworked to look
at FD/LD when reading the header length.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> index 09194b9d8322e..58d7433e8b17c 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> @@ -1412,6 +1412,25 @@ static int dwxgmac2_config_l4_filter(struct mac_device_info *hw, u32 filter_no,
> return 0;
> }
>
> +static void dwxgmac2_config_l2_split(struct mac_device_info *hw, bool en)
> +{
> + void __iomem *ioaddr = hw->pcsr;
> + u32 value;
> +
> + /* L2 split is not supported for packets with variable preamble */
> + if (en) {
> + value = readl(ioaddr + XGMAC_EXT_CFG0);
> + value &= ~XGMAC_EXT_CFG0_VPRE;
> + writel(value, ioaddr + XGMAC_EXT_CFG0);
> + }
> +
> + value = readl(ioaddr + XGMAC_EXT_CFG1);
> + value &= ~(XGMAC_CONFIG1_SPLM_MASK | XGMAC_CONFIG1_SAVE_EN);
> + if (en)
> + value |= XGMAC_CONFIG1_SPLM(1) | XGMAC_CONFIG1_SAVE_EN;
[Severity: Low]
This isn't a bug, but should the commit message say that SPLM = L2OFST
moves the split point for all split header traffic, and not only for the
tagged or non-IP packets it talks about?
Untagged and VLAN stripped IPv4/IPv6 TCP/UDP frames were previously split
at the L3/L4 header boundary. With L2OFST they would be split right after
the EtherType. Commit d10f1a4e44c3 describes the same change for dwmac4.
stmmac_hw_setup() turns this on by default for every sph_capable XGMAC2
with RX checksum offload enabled. stmmac_rx() would then build the skb head
from the 14/18 byte MAC header only. The IP/L4 headers would have to be
pulled from the buffer 2 page fragment.
Could the commit message state that this changes the RX layout for IP
traffic on existing XGMAC2 users, and ideally include some throughput
numbers?
> + writel(value, ioaddr + XGMAC_EXT_CFG1);
> +}
> +
[ ... ]
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c
> index 6719ac6e395bc..b28aa39f99472 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c
> @@ -292,8 +292,22 @@ static int dwxgmac2_get_rx_hash(struct dma_desc *p, u32 *hash,
>
> static void dwxgmac2_get_rx_header_len(struct dma_desc *p, unsigned int *len)
> {
> - if (le32_to_cpu(p->des3) & XGMAC_RDES3_L34T)
> + u32 rdes3 = le32_to_cpu(p->des3);
> +
> + /* HL is only defined on the first descriptor */
> + if (!(rdes3 & XGMAC_RDES3_FD))
> + return;
> +
> + /* when FD=1 and LD=0, HL is RDES2[9:0] */
> + if (!(rdes3 & XGMAC_RDES3_LD)) {
> + *len = le32_to_cpu(p->des2) & XGMAC_RDES2_HL;
> + return;
> + }
[Severity: Medium]
In hwif.c, the XGMAC2 entry and the XLGMAC entry both use
.desc = &dwxgmac210_desc_ops. So this parsing change applies to every
existing split header user, including XLGMAC, which never gets
config_l2_split.
If the databook statement in the commit message is right and L34T is only
valid on the last descriptor, then on FD=1/LD=0 descriptors the old code
tested an undefined field:
if (le32_to_cpu(p->des3) & XGMAC_RDES3_L34T)
*len = le32_to_cpu(p->des2) & XGMAC_RDES2_HL;
If L34T reads 0 there, hlen stays 0. stmmac_rx_buf1_len() then returns
dma_buf_sz for a header buffer that holds only HL valid bytes, so the skb
head would carry stale page data.
A remote peer can produce multi-descriptor split frames.
XGMAC_CORE_INIT_RX sets GPSLCE with GPSL = XGMAC_JUMBO_LEN (16368) whatever
the MTU, while dma_buf_sz is 1536 at MTU 1500.
Is this fixing an existing RX corruption bug inside a feature patch? If so,
could it go in a separate patch with a Fixes: tag so that stable picks it
up? The v5 changelog says the fix wording was removed on purpose. If the
old behaviour can't actually be reached, could the commit message say the
change is a no-op for existing configurations?
There is also the L2T branch further down. On XLGMAC, SPLM/SAVE_EN are
never set, yet non-IP last descriptors with L2T != 0 now take HL from
RDES2[9:2] >> 2. Are those bits guaranteed to be zero for frames XLGMAC
never split? "The callback is not implemented for XLGMAC" in the commit
message makes it sound as if XLGMAC is unaffected.
[Severity: Medium]
Is RDES2[9:0] the right layout here for non-IP frames?
This branch reads HL from RDES2[9:0] for every packet, although the packet
type isn't known on an FD=1/LD=0 descriptor. The FD=1/LD=1 non-IP branch
below uses (RDES2 & GENMASK(9, 2)) >> 2, because RDES2[1:0] carry AV
status.
The MAC may also write AV status into RDES2[1:0] of the first descriptor
for non-IP split frames. In that case a multi-descriptor non-IP/AV frame
would get HL read as roughly 4x the real value plus the status bits.
stmmac_rx_buf1_len() would return an oversized header length, and
stmmac_rx_buf2_len() would be off by the same amount.
For comparison, dwmac4_enable_sph() uses the same
GMAC_CONFIG1_SPLM(1) | GMAC_CONFIG1_SAVE_EN setup, and
dwmac4_get_rx_header_len() always reads RDES2[9:0]. Does the XGMAC
databook really make the HL bit layout depend on descriptor position?
> +
> + if (rdes3 & XGMAC_RDES3_L34T)
> *len = le32_to_cpu(p->des2) & XGMAC_RDES2_HL;
> + else if (rdes3 & XGMAC_RDES3_L2T)
> + *len = (le32_to_cpu(p->des2) & XGMAC_RDES2_NONIPHL) >> 2;
[Severity: Medium]
What happens here to non-IP frames whose L2 type is 0?
XGMAC_RDES3_L2T is GENMASK(19, 16), the same bits as XGMAC_RDES3_ET_LT, so
this check really means "L2 type != 0". In the LT encoding, 0 seems to be a
valid type: an IEEE 802.3 length encapsulated frame (LLC/SNAP, for example
STP BPDUs).
Suppose the MAC splits such a frame at the L2 offset with SPLM = L2OFST and
SAVE_EN set. Then *len stays 0, and stmmac_rx_buf1_len() skips this branch:
if (priv->sph_active && hlen) {
priv->xstats.rx_split_hdr_pkt_n++;
return hlen;
}
It returns min(dma_buf_sz, plen) instead, and stmmac_rx_buf2_len() returns
0. Wouldn't the skb then contain the split header followed by stale
page_pool data from buffer 1, with the real payload in buffer 2 dropped?
If HL is always 0 for frames the hardware doesn't split, could the L2T
check be dropped so that RDES2[9:2] is read for every non-IP FD=1/LD=1
descriptor? That would match the databook table cited in the commit
message.
> }
[ ... ]
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index f256244ce0d11..0c333d14be4d2 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
[ ... ]
> @@ -6467,6 +6469,7 @@ static int stmmac_set_features(struct net_device *netdev,
> bool sph_en = (priv->hw->rx_csum > 0) && priv->sph_active;
> u8 chan;
>
> + stmmac_config_l2_split(priv, priv->hw, sph_en);
> for (chan = 0; chan < priv->plat->rx_queues_to_use; chan++)
> stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan);
> }
[Severity: High]
This is a pre-existing issue that this patch didn't introduce, but the
patch builds on it. When RX checksum offload is turned off,
stmmac_set_features() now also calls
stmmac_config_l2_split(priv, priv->hw, false). However, priv->sph_active
is never cleared. It is only assigned at probe and in stmmac_xdp.c.
stmmac_init_rx_buffers() and stmmac_rx_refill() keep buffer 2 programmed
through stmmac_rx_check_buf2_cap(). With split header off, the DMA fills
buffer 1 and then buffer 2 of each descriptor. Meanwhile
stmmac_rx_buf1_len() still does this for every non-first descriptor:
if (priv->sph_active && len)
return 0;
Take a frame larger than 2 * dma_buf_sz, for example more than 3072 bytes
at MTU 1500. XGMAC accepts it, since XGMAC_CORE_INIT_RX sets GPSL = 16368.
Wouldn't the buffer 1 data of the second descriptor be dropped, and
stmmac_rx_buf2_len() return plen - len from a buffer 2 the DMA never
wrote?
After something like 'ethtool -K ethX rx off', that would hand stale or
uninitialized page_pool memory to the stack. Should sph_active, or the RX
length accounting, follow sph_en here?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120005243.3724402-1-sagar.cheluvegowda%40oss.qualcomm.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-24 1:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 0:52 [PATCH net-next v5] net: stmmac: dwxgmac2: enable L2 split header support Sagar Cheluvegowda
2026-11-24 1:33 ` netdev-bot+sashiko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox