Date: Thu, 17 Oct 2024 09:16:51 GMT From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 217024001f17 - stable/14 - dpaa2: fix MRU for dpni (and software vlans along) Message-ID: <202410170916.49H9Gpsa087942@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=217024001f17f8288aab98cb700b3ef8305abeee commit 217024001f17f8288aab98cb700b3ef8305abeee Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2024-10-11 18:51:32 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2024-10-16 21:50:44 +0000 dpaa2: fix MRU for dpni (and software vlans along) 0480dccd3f34 tried to fix the MTU for software VLANs given dpni announces IFCAP_VLAN_MTU. Unfortunately the initial MRU during setup is reduced from the maximum supported by the HW to our maximum ethernet RX frame length so only after further mtu toggles the solution there would work. Set the maximum RX frame size (without CRC) to jumbo length + vlan encap len by default given we also announce IFCAP_JUMBO_MTU. While here improve the manual (ioctl) MTU setting by checking if IFCAP_VLAN_MTU is currently enabled and only then add the extra bytes. Fixes: 0480dccd3f347da0dbccf5917633435d5ce6cb86 Reviewed by: dsl Differential Revision: https://reviews.freebsd.org/D47066 (cherry picked from commit fa3dfeff95a5bafcf13accaed5164bfc4e028d9a) --- sys/dev/dpaa2/dpaa2_ni.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/dev/dpaa2/dpaa2_ni.c b/sys/dev/dpaa2/dpaa2_ni.c index 6ed656849709..622e63626bfe 100644 --- a/sys/dev/dpaa2/dpaa2_ni.c +++ b/sys/dev/dpaa2/dpaa2_ni.c @@ -138,8 +138,9 @@ MALLOC_DEFINE(M_DPAA2_TXB, "dpaa2_txb", "DPAA2 DMA-mapped buffer (Tx)"); #define DPNI_IRQ_LINK_CHANGED 1 /* Link state changed */ #define DPNI_IRQ_EP_CHANGED 2 /* DPAA2 endpoint dis/connected */ -/* Default maximum frame length. */ -#define DPAA2_ETH_MFL (ETHER_MAX_LEN - ETHER_CRC_LEN) +/* Default maximum RX frame length w/o CRC. */ +#define DPAA2_ETH_MFL (ETHER_MAX_LEN_JUMBO + ETHER_VLAN_ENCAP_LEN - \ + ETHER_CRC_LEN) /* Minimally supported version of the DPNI API. */ #define DPNI_VER_MAJOR 7 @@ -2561,8 +2562,10 @@ dpaa2_ni_ioctl(if_t ifp, u_long c, caddr_t data) DPNI_UNLOCK(sc); /* Update maximum frame length. */ - error = DPAA2_CMD_NI_SET_MFL(dev, child, &cmd, - mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + mtu += ETHER_HDR_LEN; + if (if_getcapenable(ifp) & IFCAP_VLAN_MTU) + mtu += ETHER_VLAN_ENCAP_LEN; + error = DPAA2_CMD_NI_SET_MFL(dev, child, &cmd, mtu); if (error) { device_printf(dev, "%s: failed to update maximum frame " "length: error=%d\n", __func__, error);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202410170916.49H9Gpsa087942>