From nobody Sun Nov 12 11:31:15 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 4SSr3m0RGBz50LBD; Sun, 12 Nov 2023 11:31:16 +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 4SSr3m00kmz3TvC; Sun, 12 Nov 2023 11:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699788676; 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=wGWO2PYiBksE1XjmH5s6IPz2LMUhlEiPkd8zzfSB/Oc=; b=e9QO8M1NnnZd9o7+sw6s03uIOwYArw6RtboYUh63IayBwmGS9yL/kFWApnwdUW344x2htO e09q9gqKOwk015R8noBAcIfJK2BtanrxeEmWKxEk63Me5Fya1wbjJtdV8pVzm+ArrsDmR2 zoDuCU6UU8YvtgOKAiSZjfop9hXmj4Vc3VeX6HmHWiznQ7dJYH6cfw1N/gUQiuhe1ANxqx vtxyqveItQdN/YjylNMUfLqwGJ0VrjXUsq/EAUoxKka3YlsI7USZDWUhHT7CxC9rhWvj15 nvqr0YSliAbTV9A6d8kjpZrFGPeoTYSexGU6VbYNzG3/2NnVObqmkOrYPSOKSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699788676; 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=wGWO2PYiBksE1XjmH5s6IPz2LMUhlEiPkd8zzfSB/Oc=; b=bnYAWvKAMds+ue5Jq8cUGsL/+U9P6DJsAu/Qv8sU4g9FExBOe3imm0e7UqU9GASuveH3eC 6A+DfcScSwqL+8nIkkrjmsoetFmUzQZY33iii0jDUxx1nRWbgmsbJSi48MmqlwUZyTHTln Jc/7Kg/Z1lfSarfM2Dq5PlaiK4KwM5sjEejSXkoQo8NtScN2vjyvmNQXYoKoA+W27Z5vKe yJHUeIdKIMJJz0iSgHIn3lXx8Tr3wyy6B6IrgCM6kr0vC/mPRiqzDey8l/wX694IiyRGM6 kGU/eOqml4hIVdAd+vyF5k435IUGsUE+wbSf48tNufxt0zHZoecRFsVzfdbVCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699788676; a=rsa-sha256; cv=none; b=X+0oIjrnwTegIBQsybSgZD4mGQ6l+YNyVG6W5pM1kLw3OcNoGJlR4Kd55yLUfBcr6xYpU3 VcfD7cPlFn4FiP5MHZ6OuwAc3RJMTTMGKclFsxaLGbJFPOkGB3TOiKVjqikhi4KH2gKLi3 JU8gjQY13r4OOIs/e1lwS4pxY4B2QtPT76JmXjMKxPdi5ZyE83TMCYWUC2PMRUXXUyXJG6 lfrTzwN7xfFnh2NK4f2kgcuEA4UbuY5wru9XtQxHWVOArwxrnEx4wy0NzBOG7Opzo01hau sVqjaQRLAbrk6ugX+Rb0KAKEG3ZueQVqdKRpS1GGbLMl6vNv9IEDxpp5iIduDg== 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 4SSr3l69ztz6D4; Sun, 12 Nov 2023 11:31:15 +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 3ACBVF7X070731; Sun, 12 Nov 2023 11:31:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ACBVFKP070728; Sun, 12 Nov 2023 11:31:15 GMT (envelope-from git) Date: Sun, 12 Nov 2023 11:31:15 GMT Message-Id: <202311121131.3ACBVFKP070728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Rabson Subject: git: 61ba094af4b4 - stable/14 - netfront: fix the support for disabling LRO at boot time 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: dfr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 61ba094af4b4798bf2887c30af5c14d66ead706f Auto-Submitted: auto-generated The branch stable/14 has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=61ba094af4b4798bf2887c30af5c14d66ead706f commit 61ba094af4b4798bf2887c30af5c14d66ead706f Author: Doug Rabson AuthorDate: 2023-08-12 13:19:47 +0000 Commit: Doug Rabson CommitDate: 2023-11-12 10:37:16 +0000 netfront: fix the support for disabling LRO at boot time The driver has a tunable hw.xn.enable_lro which is intended to control whether LRO is enabled. This is currently non-functional - even if its set to zero, the driver still requests LRO support from the backend. This change fixes the feature so that if enable_lro is set to zero, LRO no longer appears in the interface capabilities and LRO is not requested from the backend. PR: 273046 MFC after: 1 week Reviewed by: royger Differential Revision: https://reviews.freebsd.org/D41439 (cherry picked from commit da4b0d6eb06d730487d48e15d2d5e10c56266fd9) --- sys/dev/xen/netfront/netfront.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c index b4e7722552e6..dafb838cf328 100644 --- a/sys/dev/xen/netfront/netfront.c +++ b/sys/dev/xen/netfront/netfront.c @@ -2272,7 +2272,7 @@ int create_netdev(device_t dev) { struct netfront_info *np; - int err; + int err, cap_enabled; if_t ifp; np = device_get_softc(dev); @@ -2304,7 +2304,11 @@ create_netdev(device_t dev) if_sethwassist(ifp, XN_CSUM_FEATURES); /* Enable all supported features at device creation. */ if_setcapabilities(ifp, IFCAP_HWCSUM|IFCAP_TSO4|IFCAP_LRO); - if_setcapenable(ifp, if_getcapabilities(ifp)); + cap_enabled = if_getcapabilities(ifp); + if (!xn_enable_lro) { + cap_enabled &= ~IFCAP_LRO; + } + if_setcapenable(ifp, cap_enabled); if_sethwtsomax(ifp, 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); if_sethwtsomaxsegcount(ifp, MAX_TX_REQ_FRAGS);