From nobody Sat Aug 12 08:45:35 2023 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 4RNDl70M0Hz4mBQh; Sat, 12 Aug 2023 08:45:39 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RNDl66vqWz4LnZ; Sat, 12 Aug 2023 08:45:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691829939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kA8SaqJHzcBr+QQ7j3biGTUzsYpAJiWlWw6L/pYhSjo=; b=Qa/pufdDgo2VwyjTf3wH8lxMv2YLf/5wuYBUGfaMbXxyqmHB8L4E56z7vr95/SAT/eh99J J8+ICfwFc9va8YJt39qBHvF7A4vef3F6nsU5oF+n/lhCrikoCgf4baN8uG3fQaDDKsZPyA sIfsV1bJs3uKlyursNtqM+bOFiBRKU9Xv4ajiuEhmbwsRKhcjjW4m6r70MwHEvt87VapFk eluKRoKn7raScjkpuGK1oBFQoallUHAVsaLMDhJiYpLk39XXPKI59iUcAIJ+nz6vnNNXFM AWfJsLrpnAeBwe5nhSZQLU++au/2avu4NK+tFAyorAR91eYAwkjst808meQ4tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691829939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kA8SaqJHzcBr+QQ7j3biGTUzsYpAJiWlWw6L/pYhSjo=; b=shy8LXPR/aPuTAG3ITNW4HuVte6UZ2Nx1S1GexXPYdvZquPa/Xu3LIox+D1/m+BlPpukCY RkD2hv4R5eJhUng1QY2MOjEnDnekUCcSoZxDnEdDK/+GOdd/MkESOUu0cZyfJC5YkTvray AEhEaHar0wZjNksHA6nkr+50ONIWuypL5jXIJYnMA3LJFad0csRnvcghI/LonORwysbRV6 /0yFlldXY6oB9hCXKerGkFjt2TJACcbNBXedgKj9cSZI58WYFVfUjMyfbqIFv7OYQ5VBWP 76vZbipu3GdlD/f5r6IOPs8RwSe9Iu+8S3tpS+7Ar4sMiGUsNQw3pDVdnDhXFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691829939; a=rsa-sha256; cv=none; b=nKOwVY0VChaVtsXv9kStyuTJbhACg32ZeF403+IRVdWFXStbjI2PfHzptz5s+Jgwyy6YU/ GzhBLgrBIIAdWW2DPyQtOMsT5702l5iApTQqJaO/3rXPIkaLCYvYqIlBk2oe5l6XxOswsW uRZ0G4OpNCT6A8H/e2wRZKoERfJ5qRQlJUl5WWejV7I4x4CJutSg77w7j6P/iMdD/eU/i9 2ZHGDPtRv4eFwRNf+Lw+B2ICzhYhxIQgMaDRAFyzxV/aviJmqav9OjGlfqaWcPy3gj4XYS 68muKUQYaW+CIBBG0eWeFnQ26jBwhTR4ySl9FA/tVbSJX91PzilFIFre00aKQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4RNDl64XXcz1MGM; Sat, 12 Aug 2023 08:45:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 949C81C508; Sat, 12 Aug 2023 10:45:36 +0200 (CEST) From: Kristof Provost To: Kevin Bowling Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5f11a33ceeb3 - main - if_vlan: do not enable LRO for bridge interaces Date: Sat, 12 Aug 2023 10:45:35 +0200 X-Mailer: MailMate (1.14r5937) Message-ID: In-Reply-To: References: <202308112251.37BMpOnC064624@gitrepo.freebsd.org> 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I also don=E2=80=99t have a setup to reproduce the issues Paul reported. Given the discussion in the PR I assumed everyone was happy with the fix = he posted. Best regards, Kristof On 12 Aug 2023, at 3:28, Kevin Bowling wrote: > I think this may be a better fix, currently untested > > diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c > index 6aa872a19364..51f0bc63ebda 100644 > --- a/sys/net/if_vlan.c > +++ b/sys/net/if_vlan.c > @@ -2074,7 +2074,7 @@ vlan_capabilities(struct ifvlan *ifv) > if (p->if_capabilities & IFCAP_VLAN_HWCSUM) > cap |=3D p->if_capabilities & IFCAP_LRO; > if (p->if_capenable & IFCAP_VLAN_HWCSUM) > - ena |=3D p->if_capenable & IFCAP_LRO; > + ena |=3D mena & IFCAP_LRO; > > /* > * If the parent interface can offload TCP connections over VLAN= s then > > On Fri, Aug 11, 2023 at 5:07=E2=80=AFPM Kevin Bowling wrote: >> >> I am wondering what is going on with this patch, it doesn't seem like >> a full fix. At the very least we should clean up the "can't disable >> some capabilities" message. >> >> I've been looking at this for a couple hours and am wondering what is >> going on in if_bridge.. it looks like it correctly loops over the >> interfaces and masks ifcaps it doesn't like using the interface's >> ioctl SIOCSIFCAP. A similar pattern is used in if_lagg. I don't see >> any issue there so far. I also don't see the SIOCSICAP ioctl failing >> nor did vixie's message report that. >> >> I checked on a cxgbe(9) bridged vlan setup I have and see this message= >> "bridge0: can't disable some capabilities on vlan0: 0x400" >> >> So I am wondering if the bug is that if_vlan SIOCSIFCAP is >> disregarding the ioctl's request mask.. it is just blindly calling >> vlan_capabilities. >> >> Regards, >> Kevin >> >> >> On Fri, Aug 11, 2023 at 3:51=E2=80=AFPM Kristof Provost wrote: >>> >>> The branch main has been updated by kp: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D5f11a33ceeb385477cb22d= 9ad5941061c5a26be9 >>> >>> commit 5f11a33ceeb385477cb22d9ad5941061c5a26be9 >>> Author: Paul Vixie >>> AuthorDate: 2023-08-11 18:17:16 +0000 >>> Commit: Kristof Provost >>> CommitDate: 2023-08-11 22:50:37 +0000 >>> >>> if_vlan: do not enable LRO for bridge interaces >>> >>> If the parent interface is not a bridge and can do LRO and >>> checksum offloading on VLANs, then guess it may do LRO on VLANs. >>> False positive here cost nothing, while false negative may lead >>> to some confusions. According to Wikipedia: >>> >>> "LRO should not operate on machines acting as routers, as it brea= ks >>> the end-to-end principle and can significantly impact performance= =2E" >>> >>> The same reasoning applies to machines acting as bridges. >>> >>> PR: 254596 >>> MFC after: 3 weeks >>> --- >>> sys/net/if_vlan.c | 22 +++++++++++++++------- >>> 1 file changed, 15 insertions(+), 7 deletions(-) >>> >>> diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c >>> index 6aa872a19364..92e4e4247e3d 100644 >>> --- a/sys/net/if_vlan.c >>> +++ b/sys/net/if_vlan.c >>> @@ -2067,14 +2067,22 @@ vlan_capabilities(struct ifvlan *ifv) >>> } >>> >>> /* >>> - * If the parent interface can do LRO and checksum offloading= on >>> - * VLANs, then guess it may do LRO on VLANs. False positive = here >>> - * cost nothing, while false negative may lead to some confus= ions. >>> + * If the parent interface is not a bridge and can do LRO and >>> + * checksum offloading on VLANs, then guess it may do LRO on V= LANs. >>> + * False positive here cost nothing, while false negative may = lead >>> + * to some confusions. According to Wikipedia: >>> + * >>> + * "LRO should not operate on machines acting as routers, as i= t breaks >>> + * the end-to-end principle and can significantly impact perfo= rmance." >>> + * >>> + * The same reasoning applies to machines acting as bridges. >>> */ >>> - if (p->if_capabilities & IFCAP_VLAN_HWCSUM) >>> - cap |=3D p->if_capabilities & IFCAP_LRO; >>> - if (p->if_capenable & IFCAP_VLAN_HWCSUM) >>> - ena |=3D p->if_capenable & IFCAP_LRO; >>> + if (ifp->if_bridge =3D=3D NULL) { >>> + if (p->if_capabilities & IFCAP_VLAN_HWCSUM) >>> + cap |=3D p->if_capabilities & IFCAP_LRO; >>> + if (p->if_capenable & IFCAP_VLAN_HWCSUM) >>> + ena |=3D p->if_capenable & IFCAP_LRO; >>> + } >>> >>> /* >>> * If the parent interface can offload TCP connections over V= LANs then >>>