From nobody Tue May 07 20:14:07 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 4VYqHN00k3z5Jb2Q; Tue, 07 May 2024 20:14:08 +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 4VYqHM6TMyz51pF; Tue, 7 May 2024 20:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715112847; 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=GpRs7XlRCIhYlm/kAe6BXGhZLpTNHLFGh7WVWbPBymo=; b=MfzPouaX6sEEs80Waze37xvLuZwe5bPy58lrtqnf1uBgr+Mx5ITu2DFQFxWJuuYwepRvp9 oLZB9KnVgtjJDHAX2dfWGbFXog+2wJaw/O6zW6F+TflLBR3zSdQZmSdlwqNQUZc23lIqlr YDGNqmTPUHXvevQ546qAeIMkSGEBEVYwo0EVOQ420zbhF2XTmGM2nCNR5/cl+ofiDD+1H6 FHWEga/F1855Yq6JVW64edCrnTR6jbywVBMKzNDNwK8NRJTg/xtSxSozuYSutNFvsF0l2u rqEFArMt5QQ+frylwf1ttjBABD/L3dftkcT1luA3wVSmvI0zYumIYaQDuEpX6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715112847; a=rsa-sha256; cv=none; b=STHMkjM+g1zcB+drgVC/PuqfjbKVpj0qatY0qZIP/JjsAYKbPnePfY861J57fSbzcAFgkA 7rn0LU/FmSVvjESHIT/NQPi36A7LO+NuQi2MojWXwL6S7EFwl96qVvNhPAdNj0Lu5mSwE2 pVgAU+OG5Qt8q2rrzKdeTVRKc8BX++X8QCSwa9S46fAKuYzEosf7UmYQScNMCaL4Os+8cz 8CM4++AoCjbmu25S2zvTOPaML6POijU4ZOPezi6w+skIIKhmOuEauuikDi4bQPD9fwz1q9 /jkTstuPYeaWb7WBkotA5Kg0x9uNq7tS/E8WA0muNt8tpa3qzmdbayvUmFyJPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715112847; 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=GpRs7XlRCIhYlm/kAe6BXGhZLpTNHLFGh7WVWbPBymo=; b=c6EnaSujqZpUoORPbJBVUaKd4peP3tl4RSviVbSe8tmtihFG3qebRtHfNkx3GldT/gMLL5 18VW7u/Nb4yrXZNN17VbVPK8/eQKwvsbjIe5bXG/sf01YDYtnbosiXUoCADeSEVbr225Vq 7UGrQwMt3EaxQKfgtO+zzpjYOg6wT4CCxB2kEjOZ09gqSfQLDOnKAtyNTFpfXW5IkFh1w5 auAXShBiJxIYP+Z1dcmu8I98L26aNWSGnx3UxbAa+PwGPulhGKN22H/HWybjzcYrCoTYEJ wGMk+YL+g43F8DT1IA/ucePumPqzCxxTIjvgKzKLVTTZeJfr53U6DaehojFrCg== 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 4VYqHM64jXzwCx; Tue, 7 May 2024 20:14:07 +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 447KE7V5072436; Tue, 7 May 2024 20:14:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 447KE7bu072433; Tue, 7 May 2024 20:14:07 GMT (envelope-from git) Date: Tue, 7 May 2024 20:14:07 GMT Message-Id: <202405072014.447KE7bu072433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 59884aea8b98 - main - tcp: clean up macro useage in tcp_fixed_maxseg() 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: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59884aea8b98781ecc7ad2d490a9210aab750de3 Auto-Submitted: auto-generated The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=59884aea8b98781ecc7ad2d490a9210aab750de3 commit 59884aea8b98781ecc7ad2d490a9210aab750de3 Author: Richard Scheffenegger AuthorDate: 2024-05-04 08:42:42 +0000 Commit: Richard Scheffenegger CommitDate: 2024-05-04 11:04:25 +0000 tcp: clean up macro useage in tcp_fixed_maxseg() Replace local PAD macro with PADTCPOLEN macro No functional change. Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D45076 --- sys/netinet/tcp_subr.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 306053ae8289..b17231a243f1 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -3530,7 +3530,6 @@ tcp_maxseg(const struct tcpcb *tp) if (tp->t_flags & TF_SACK_PERMIT) optlen += PADTCPOLEN(TCPOLEN_SACK_PERMITTED); } -#undef PAD optlen = min(optlen, TCP_MAXOLEN); return (tp->t_maxseg - optlen); } @@ -3552,7 +3551,6 @@ tcp_fixed_maxseg(const struct tcpcb *tp) * for cc modules to figure out what the modulo of the * cwnd should be. */ -#define PAD(len) ((((len) / 4) + !!((len) % 4)) * 4) if (TCPS_HAVEESTABLISHED(tp->t_state)) { if (tp->t_flags & TF_RCVD_TSTMP) optlen = TCPOLEN_TSTAMP_APPA; @@ -3560,23 +3558,22 @@ tcp_fixed_maxseg(const struct tcpcb *tp) optlen = 0; #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE) if (tp->t_flags & TF_SIGNATURE) - optlen += PAD(TCPOLEN_SIGNATURE); + optlen += PADTCPOLEN(TCPOLEN_SIGNATURE); #endif } else { if (tp->t_flags & TF_REQ_TSTMP) optlen = TCPOLEN_TSTAMP_APPA; else - optlen = PAD(TCPOLEN_MAXSEG); + optlen = PADTCPOLEN(TCPOLEN_MAXSEG); if (tp->t_flags & TF_REQ_SCALE) - optlen += PAD(TCPOLEN_WINDOW); + optlen += PADTCPOLEN(TCPOLEN_WINDOW); #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE) if (tp->t_flags & TF_SIGNATURE) - optlen += PAD(TCPOLEN_SIGNATURE); + optlen += PADTCPOLEN(TCPOLEN_SIGNATURE); #endif if (tp->t_flags & TF_SACK_PERMIT) - optlen += PAD(TCPOLEN_SACK_PERMITTED); + optlen += PADTCPOLEN(TCPOLEN_SACK_PERMITTED); } -#undef PAD optlen = min(optlen, TCP_MAXOLEN); return (tp->t_maxseg - optlen); }