From nobody Sat Oct 12 23:04:54 2024 X-Original-To: dev-commits-src-main@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 4XQzbW0hyjz5Z6ft; Sat, 12 Oct 2024 23:04:55 +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 4XQzbW0DLWz4fx3; Sat, 12 Oct 2024 23:04:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728774295; 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=s3XBi3mmAKj3SM284Gq4papG4XI1F3j3rPKfcbbIifc=; b=Msdgu5deHUJTlEAZl35p0peH9mUhDFI0vYNVUpaDzoYva0C9mol16ltjR3NE+AgG6hrXw4 N3J351LgefOVHjxYE+xhXzsV+xRlxSY44I1kiwzu2WgwcsMF7EhzrY1XZUXfX3TKFuOzan Mbm3CEQ8wdEQznDO+66Bl1JQCaTGUkFLUN4sahSUrMROMEmfzPFonlGKNazel1+RNgL9EK +4/gS3W0chln2aBSYdjd2G8WWz4tDqxeokgSqPv7FPQO0sarKa/t8kX/fa7c7Yr75rzskg r3MBEG0bBDNkjGAaAkQfcPzHIJGnLH0u93erij5FGk0Y/jLUjR+DCaf6iHQUmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728774295; 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=s3XBi3mmAKj3SM284Gq4papG4XI1F3j3rPKfcbbIifc=; b=qFIawy3mYAZItgOd93JRh9P+Z1JY4UPypOEXCo9ruBXPhYeHYpdFN421zBYgZSbn7jwH29 dVadw4WZSLYe2ACttMu76RGF4a6EfK79Sy2zDlSir4r3Ixs9RHhbmqbzuIRJXG5ur78RND acCePTB92bnNxiuRrzXG0r3ixqVnQHA3Y1InWEcM90aPxk/SRkOay25oZw8pB2kB8IXerh 0DgauFv7RN3wbg/V9ElTuVwDwD/L1mZ/DIxhmMS7QSN0k5mgtwvITWsL4hL1CxfmQygZzs 41r2wnLklbocGGWXYMgqEcX76MOdgivdRha09rljSeuKOF0kmahukjH7cm+g1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728774295; a=rsa-sha256; cv=none; b=WjaW39/ixcDg9VrcgrGapQDRvd0DT5mETSwxMgtdPE5y4cPJaS1G8mn4BPDD1hJuCSjr5Q TCpTZOVZ4sandX8f6vS6cuE6uFnbvKUnObzaOQ4ZRWdd5eOWJj0ZOMlAV2w4q0vHY3ZcJk RSZRUvMypwn91yZRo6YfiFGj1WzixqmkJvuJgucGBgJSPG05S7wUIavshYHbbaCSR6cCxX kH1D6Ug1LHMKKDoCo4umvyTQyZeyAM9dVVK1o31adxDNsON1+Ajo2+kAJTpY+YoShRWlyI Q4ILxIc4EqKiLl8CvBVoye+zZbfOD5tL+OMR1W72K8CSmZI6XHPCHRZNNjo6sg== 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 4XQzbV6xlkzV8b; Sat, 12 Oct 2024 23:04:54 +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 49CN4sDU057835; Sat, 12 Oct 2024 23:04:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49CN4sf1057833; Sat, 12 Oct 2024 23:04:54 GMT (envelope-from git) Date: Sat, 12 Oct 2024 23:04:54 GMT Message-Id: <202410122304.49CN4sf1057833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: fa3dfeff95a5 - main - dpaa2: fix MRU for dpni (and software vlans along) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: fa3dfeff95a5bafcf13accaed5164bfc4e028d9a Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=fa3dfeff95a5bafcf13accaed5164bfc4e028d9a commit fa3dfeff95a5bafcf13accaed5164bfc4e028d9a Author: Bjoern A. Zeeb AuthorDate: 2024-10-11 18:51:32 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-12 22:13:39 +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 MFC after: 3 days Reviewed by: dsl Differential Revision: https://reviews.freebsd.org/D47066 --- 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);