From: Matthieu Baerts <matttbe@kernel.org>
To: Tomas Hlavacek <tmshlvck@gmail.com>, netdev@vger.kernel.org
Cc: linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, dlan@kernel.org, wangruikang@iscas.ac.cn,
stable@vger.kernel.org, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH net v3] net: spacemit: k1-emac: fix jumbo frame support: manual merge
Date: Tue, 3 Feb 2026 10:39:02 +0100 [thread overview]
Message-ID: <4819ec3b-23b4-447b-b10b-0bd93a40dc5a@kernel.org> (raw)
In-Reply-To: <20260130102301.477514-1-tmshlvck@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1790 bytes --]
Hello,
+cc: Mark for Linux Next
On 30/01/2026 11:23, Tomas Hlavacek wrote:
> The driver never programs the MAC frame size and jabber registers,
> causing the hardware to reject frames larger than the default 1518
> bytes even when larger DMA buffers are allocated.
>
> Program MAC_MAXIMUM_FRAME_SIZE, MAC_TRANSMIT_JABBER_SIZE, and
> MAC_RECEIVE_JABBER_SIZE based on the configured MTU. Also fix the
> maximum buffer size from 4096 to 4095, since the descriptor buffer
> size field is only 12 bits. Account for double VLAN tags in frame
> size calculations.
FYI, we got a small conflict when merging 'net' in 'net-next' in the
MPTCP tree due to this patch applied in 'net':
3125fc170169 ("net: spacemit: k1-emac: fix jumbo frame support")
and this one from 'net-next':
f66086798f91 ("net: spacemit: Remove broken flow control support")
----- Generic Message -----
The best is to avoid conflicts between 'net' and 'net-next' trees but if
they cannot be avoided when preparing patches, a note about how to fix
them is much appreciated.
The conflict has been resolved on our side [1] and the resolution we
suggest is attached to this email. Please report any issues linked to
this conflict resolution as it might be used by others. If you worked on
the mentioned patches, don't hesitate to ACK this conflict resolution.
---------------------------
Regarding this conflict, both commits modified independent code from the
same context: code related to the flow control has been removed, and the
one to frame/jabber size has been added.
Rerere cache is available in [2].
Cheers,
Matt
1: https://github.com/multipath-tcp/mptcp_net-next/commit/286ef2be604b
2: https://github.com/multipath-tcp/mptcp-upstream-rr-cache/commit/45e15
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
[-- Attachment #2: 286ef2be604bcb5d4ec28bb2d194865f61a52088.patch --]
[-- Type: text/x-patch, Size: 1565 bytes --]
diff --cc drivers/net/ethernet/spacemit/k1_emac.c
index 40c9504b7444,b49c4708bf9e..dab0772c5b9d
--- a/drivers/net/ethernet/spacemit/k1_emac.c
+++ b/drivers/net/ethernet/spacemit/k1_emac.c
@@@ -193,7 -201,9 +194,7 @@@ static void emac_reset_hw(struct emac_p
static void emac_init_hw(struct emac_priv *priv)
{
- u32 rxirq = 0, dma = 0;
- /* Destination address for 802.3x Ethernet flow control */
- u8 fc_dest_addr[ETH_ALEN] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x01 };
+ u32 rxirq = 0, dma = 0, frame_sz;
regmap_set_bits(priv->regmap_apmu,
priv->regmap_apmu_offset + APMU_EMAC_CTRL_REG,
@@@ -218,6 -228,21 +219,15 @@@
DEFAULT_TX_THRESHOLD);
emac_wr(priv, MAC_RECEIVE_PACKET_START_THRESHOLD, DEFAULT_RX_THRESHOLD);
+ /* Set maximum frame size and jabber size based on configured MTU,
+ * accounting for Ethernet header, double VLAN tags, and FCS.
+ */
+ frame_sz = priv->ndev->mtu + ETH_HLEN + 2 * VLAN_HLEN + ETH_FCS_LEN;
+
+ emac_wr(priv, MAC_MAXIMUM_FRAME_SIZE, frame_sz);
+ emac_wr(priv, MAC_TRANSMIT_JABBER_SIZE, frame_sz);
+ emac_wr(priv, MAC_RECEIVE_JABBER_SIZE, frame_sz);
+
- /* Configure flow control (enabled in emac_adjust_link() later) */
- emac_set_mac_addr_reg(priv, fc_dest_addr, MAC_FC_SOURCE_ADDRESS_HIGH);
- emac_wr(priv, MAC_FC_PAUSE_HIGH_THRESHOLD, DEFAULT_FC_FIFO_HIGH);
- emac_wr(priv, MAC_FC_HIGH_PAUSE_TIME, DEFAULT_FC_PAUSE_TIME);
- emac_wr(priv, MAC_FC_PAUSE_LOW_THRESHOLD, 0);
-
/* RX IRQ mitigation */
rxirq = FIELD_PREP(MREGBIT_RECEIVE_IRQ_FRAME_COUNTER_MASK,
EMAC_RX_FRAMES);
next prev parent reply other threads:[~2026-02-03 9:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 10:23 [PATCH net v3] net: spacemit: k1-emac: fix jumbo frame support Tomas Hlavacek
2026-02-03 4:20 ` patchwork-bot+netdevbpf
2026-02-03 9:39 ` Matthieu Baerts [this message]
2026-02-03 10:25 ` [PATCH net v3] net: spacemit: k1-emac: fix jumbo frame support: manual merge Vivian Wang
2026-02-03 18:22 ` Tomas Hlavacek
2026-02-20 4:11 ` [PATCH net v3] net: spacemit: k1-emac: fix jumbo frame support patchwork-bot+linux-riscv
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=4819ec3b-23b4-447b-b10b-0bd93a40dc5a@kernel.org \
--to=matttbe@kernel.org \
--cc=broonie@kernel.org \
--cc=davem@davemloft.net \
--cc=dlan@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=spacemit@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=tmshlvck@gmail.com \
--cc=wangruikang@iscas.ac.cn \
/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