From nobody Thu Oct 17 09:16:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XThzm2RDgz5Ym3K; Thu, 17 Oct 2024 09:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XThzm0XXFz4Hrn; Thu, 17 Oct 2024 09:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729156612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZR3qLbN2/34s0Q7USLJON9J6lKaltjqguPIVABuF/c=; b=ty8Tjf5IkxKkZW6chLtGCKHJ4yVoNBBJ5kaDWpXTnRjCC4Sp58YHpb5ALzgjTOiDZWhFh2 47ep3HYR8mXNh+LbbfFuy2eO10dknvRI/gXGakBAioB8GgXbe+t19nfZ+ww0WL3if31hH8 FzaorD8AvUJI2uKjskDacbyg2EhivcaIAQS3kHEgKSCi3+ykvNFnPloQkmGLUXCpHh7rbG 5QE3XM1GaU81fLELcVa6BZhOFPHAfA0osXB0DsxUpJ/XzewqN0VUrvdUvpzQSoa0NTlAND nZcq8TuXJ2jjPbl9UAQzzHHwnqLV8OCVuPQFb9tskqYSF9xHTRpvoXmn7Z1vnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729156612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZR3qLbN2/34s0Q7USLJON9J6lKaltjqguPIVABuF/c=; b=yizCQbFE/DmTAMjjsX6Uu/hoBOIGtwI8hu6toWwtG3Oxj2tyv06eq9iPkbGwnHR+wfl5U2 JYBlYOgkicYDDVE3YPYIKNp85717S5G1/nM6++HYw/xj2F67PauUaGgRy1BCJAsSfoqWT9 0wniOpnS/HpTnptttTmzcIN16Exml2LAjsalEWMOx6ufW1mgRhTbgZXFiPNnV+Cvjk7iEA 9W75y7xsb+IBY0VI2zNPSRC6pCObMqxF3J4UW9DnVroqIkCyEfXU8y2mm8SdlNN5/jrx6F GgqP1q+oJ1bXMULIyrWfsmhZjSGzRIvOxuQ9QEYzHgG0SUeotAnECWy19MBjtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729156612; a=rsa-sha256; cv=none; b=xZDKKGEMem4t+OWADsMRsKicGFxWKpIKyrVYsVdjwwaC4kxuQRwxsIyMyp86tJvqxg5qP8 PVRTpyCaU8Y3Ahp177ub76HhxoJ5JuSxSfqEIOUMLvAtxFN0v8tYKK1fpP35WD5acg3Zsn KIr7rHMiZ9Qqh2l1cncwTEOUCmVLx01Z6s4VG9E7V5gXkm0+ndtGhm342h0eciC1QXI+mN GMzPQ4yEtKEgjDIS80FtCVeG4P6M/HIPwCzFKhhHxH8kHTMzagmEGte6UWTGHrAiY6wnrN btGwAr+8jOQZXQwzCjJjIvun+gXOfeIu8vcBWBQF/WxX7r4LSPX9j/wvUTU8zA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XThzm06RqzkZR; Thu, 17 Oct 2024 09:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49H9GpWa087945; Thu, 17 Oct 2024 09:16:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49H9Gpsa087942; Thu, 17 Oct 2024 09:16:51 GMT (envelope-from git) Date: Thu, 17 Oct 2024 09:16:51 GMT Message-Id: <202410170916.49H9Gpsa087942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 217024001f17 - stable/14 - dpaa2: fix MRU for dpni (and software vlans along) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 217024001f17f8288aab98cb700b3ef8305abeee Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=217024001f17f8288aab98cb700b3ef8305abeee commit 217024001f17f8288aab98cb700b3ef8305abeee Author: Bjoern A. Zeeb AuthorDate: 2024-10-11 18:51:32 +0000 Commit: Bjoern A. Zeeb 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);