From nobody Fri Aug 11 22:51:24 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 4RMzYS3pqwz4prVV; Fri, 11 Aug 2023 22:51:24 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RMzYS3CWVz4FTs; Fri, 11 Aug 2023 22:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691794284; 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=Wmlg0jzfqG0X0B6aqQXntk0PKs+RXfxyg7WwqdqFX6Q=; b=unCrcdJIbPdVWCLzXcnOMQh8Us9jKcLIrHYXfrEr+/nzQjl5hnvOEk9rjg77uXexdoXu56 2dbSI+P20qbm18Isqs9OAIyjmhxpJZ5mxfFg7DtgXaglm0KuDdhtRXs36oQ0NYgJxBqnbn cp9cwZeHucxtU5egb0tbxRO1erNkg0WZeKVAFuInhyu7Q3Sg25bcjZILt18gPQkgDSijAa aKzcPFa/HMeED58vvh/gPQWBmXWoh85NM8ChPCmzBCiNu++9tDBIESEdUEgRdMrQGaaIra zWkfIy+T1y3/71+If+8ORllcD6NcpJPs2qdlXibasUiRg90fEvVekmm2cj72MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691794284; 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=Wmlg0jzfqG0X0B6aqQXntk0PKs+RXfxyg7WwqdqFX6Q=; b=SDwjKybf1GNXVTxPZRmqOkhXIigoN5I9OTjyjsp3reEE/JrIoDprm5a8HOmQ65UXh458TM 9EjnDEXhAVfSS62dSE//jNgoX1yF2TDZnRyTVlWsyQdbhgfhUbVja/vYMPn1aIuqUu0wZ5 PiFdkC49vdSSmTEfVPPU6oswM2B27Kjs/rktu3KKKVGxBfxDvuSaOA22xhIBjNOAONhDow TuW1SGxvYCSLnf9OHorIMJ7OP0qKqkMkpL9wdXLF3nt6UAJwMgG4fwB0j9HRmXrYxDAO7R sIVkK4fPwyykTngqympDqzPyX3bhQsIa4/cIwKYxQHWhdDLJeR5DyViIlmVM8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691794284; a=rsa-sha256; cv=none; b=g6xUSgagRAyncrw5cwuWGAmHTPtbLBylxWzFhRx9OdUDG5WUSn9Rol3FaJ2aAEeDDhROsa Uh06K1kcXRqkpm0rGz/lbeM72f2LRbRuLGvBIJzjZJpBVjaRyFK1MEu7T34RVRbO03FFAJ Di07eO4w7wQbVVxt8bZR71j6nqLRXQlI5lqFAbcwkkKLyYhdtwPHu8QKg1yMqgxTJZ/iJ9 YiR8+rVqzSwSCjZvmTMmkoMbHtExzL6MHhsYEHhM7QlXuM+lMSCbaLLYasiDqO7FEeNuZG LENen3/kBfLt3U5z4/VBu4fG0cwsdRTD8I0vD+F3pg2C3xvG6AvB0a4NVEiG/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RMzYS2G5YzxLX; Fri, 11 Aug 2023 22:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37BMpONj064627; Fri, 11 Aug 2023 22:51:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37BMpOnC064624; Fri, 11 Aug 2023 22:51:24 GMT (envelope-from git) Date: Fri, 11 Aug 2023 22:51:24 GMT Message-Id: <202308112251.37BMpOnC064624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5f11a33ceeb3 - main - if_vlan: do not enable LRO for bridge interaces 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: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f11a33ceeb385477cb22d9ad5941061c5a26be9 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5f11a33ceeb385477cb22d9ad5941061c5a26be9 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 breaks the end-to-end principle and can significantly impact performance." 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 confusions. + * 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 breaks + * the end-to-end principle and can significantly impact performance." + * + * The same reasoning applies to machines acting as bridges. */ - if (p->if_capabilities & IFCAP_VLAN_HWCSUM) - cap |= p->if_capabilities & IFCAP_LRO; - if (p->if_capenable & IFCAP_VLAN_HWCSUM) - ena |= p->if_capenable & IFCAP_LRO; + if (ifp->if_bridge == NULL) { + if (p->if_capabilities & IFCAP_VLAN_HWCSUM) + cap |= p->if_capabilities & IFCAP_LRO; + if (p->if_capenable & IFCAP_VLAN_HWCSUM) + ena |= p->if_capenable & IFCAP_LRO; + } /* * If the parent interface can offload TCP connections over VLANs then