From nobody Thu Nov 21 00:39:13 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 4XtzrK6z9vz5dxsG; Thu, 21 Nov 2024 00:39:13 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XtzrK4mHCz4HKx; Thu, 21 Nov 2024 00:39:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732149553; 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=YwrwCmO/lIsZVY6pFn6cDRhFHaF1ueixl+kp1AYJfOY=; b=CQBOuTrQ1hVy9gu1xuB0pTPPUS77caYw5Im9wRcX6bINXNG87zwrZdAsw5SxBXNH1r8ljU eHyLJDi1PE2EPJ2XzuWgSoLR4OrmdXvxao9BHMahD0LaO/9MbosE9kleC5q+H/pth+OKON 0BbFFAd/pGObHwkX5Fba3Xfn/bN9nlqr3MhfMB+TznHbENB+7GPCOeEjYJpwsuNLtVFUor GXvirO1bLc+cFxJL+v+h0yG8KTqGjJpRbJy7iybY6200hJHu9FCpyhglKJup7bhhWXkxE0 KyrnCHa6OGaSovBbs6VhwUiAPqanuJ91F1M42tofP257BXqA/mWDt6334oA8Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732149553; 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=YwrwCmO/lIsZVY6pFn6cDRhFHaF1ueixl+kp1AYJfOY=; b=J5YBX22T/g/2kANSVEDk0uTx5AR5fnRoSQSf/PbgorQ73PlPtnHo8S6YAPalTTz+QFaDo7 uXqqYJ4pTj2c/ifBjb9DU3vB0cBVScvnDlODn2rF4LiTaQCVASXhrESC52qjTTPRIPaPt0 Q1ZYeMa+OlhfPMrkKtDj0LFm2JJF+W5ieIjkUlY/y1WyIjoCb3c3wR6c5KY80IiQzfj+G2 frZ+mIJ5KHiqE0JUK8TeRj4GIPl6OAido9odjIr5ajYuKs+GCj9iG15niYPalt+oApoP2p OYtlefxXlagBb3M7+qvw6iH1wUl24fuzWuwARef5+lHksSJpoXw+kQDzcfQ7iA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732149553; a=rsa-sha256; cv=none; b=KTc1h3ztfZkrH6TYr7OUo/pcawxrYgOU+rNFBqCMTnYD5/BmuWKsmpSFBHD9WUaKoASixp o6NEc22lo304ohUDth32HKuHfcUZ9f8CF5GLnRHooxIvl7b8tT40eE3WK0zl+vWh78/1/P kOKq23TLX18FqioniZaFmbSnkoxfObqzrNeZRfKpSZJPiHZ+3fm+wp17VInlMQls8kf5n7 BzjIhj4sqNOSAyoi8BQdzIcE4uVDzJqy0wpBocU6eStgiXLFgOZfiN7bCf6vlyTk5ruNcC Yz7Zn5fSnfiOV7H1xuvKa6wRdbOcRt1+zmLy1aAY+0KN9G/D9E5FCfSrg0sCIQ== 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 4XtzrK47tdzHCZ; Thu, 21 Nov 2024 00:39:13 +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 4AL0dD6Z044571; Thu, 21 Nov 2024 00:39:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AL0dDZh044568; Thu, 21 Nov 2024 00:39:13 GMT (envelope-from git) Date: Thu, 21 Nov 2024 00:39:13 GMT Message-Id: <202411210039.4AL0dDZh044568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 3789810845f1 - main - tcp: avoid bcopy() in tcp_mss_update() 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3789810845f14102c88ca31f7dccb18621b960a0 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3789810845f14102c88ca31f7dccb18621b960a0 commit 3789810845f14102c88ca31f7dccb18621b960a0 Author: Gleb Smirnoff AuthorDate: 2024-11-21 00:35:59 +0000 Commit: Gleb Smirnoff CommitDate: 2024-11-21 00:37:24 +0000 tcp: avoid bcopy() in tcp_mss_update() --- sys/netinet/tcp_input.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index f9ecdf93cc47..03d493b1d7a9 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3877,19 +3877,16 @@ tcp_mss_update(struct tcpcb *tp, int offer, int mtuoffer, offer = max(offer, V_tcp_minmss); } - /* - * rmx information is now retrieved from tcp_hostcache. - */ - tcp_hc_get(&inp->inp_inc, &metrics); - if (metricptr != NULL) - bcopy(&metrics, metricptr, sizeof(struct hc_metrics_lite)); + if (metricptr == NULL) + metricptr = &metrics; + tcp_hc_get(&inp->inp_inc, metricptr); /* * If there's a discovered mtu in tcp hostcache, use it. * Else, use the link mtu. */ - if (metrics.hc_mtu) - mss = min(metrics.hc_mtu, maxmtu) - min_protoh; + if (metricptr->hc_mtu) + mss = min(metricptr->hc_mtu, maxmtu) - min_protoh; else { #ifdef INET6 if (isipv6) {