From owner-svn-src-all@freebsd.org Thu Sep 26 15:06:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41360129794; Thu, 26 Sep 2019 15:06:47 +0000 (UTC) (envelope-from jtl@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46fJDR0yCyz4M85; Thu, 26 Sep 2019 15:06:47 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0503B1EFD; Thu, 26 Sep 2019 15:06:47 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8QF6kQO032362; Thu, 26 Sep 2019 15:06:46 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QF6kTG032361; Thu, 26 Sep 2019 15:06:46 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201909261506.x8QF6kTG032361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 26 Sep 2019 15:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352745 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2019 15:06:47 -0000 Author: jtl Date: Thu Sep 26 15:06:46 2019 New Revision: 352745 URL: https://svnweb.freebsd.org/changeset/base/352745 Log: Access the syncache secret directly from the V_tcp_syncache variable, rather than indirectly through the backpointer to the tcp_syncache structure stored in the hashtable bucket. This also allows us to remove the requirement in syncookie_generate() and syncookie_lookup() that the syncache hashtable bucket must be locked. Reviewed by: gallatin, rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21644 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Sep 26 15:02:34 2019 (r352744) +++ head/sys/netinet/tcp_syncache.c Thu Sep 26 15:06:46 2019 (r352745) @@ -2061,8 +2061,6 @@ syncookie_generate(struct syncache_head *sch, struct s uint8_t *secbits; union syncookie cookie; - SCH_LOCK_ASSERT(sch); - cookie.cookie = 0; /* Map our computed MSS into the 3-bit index. */ @@ -2090,10 +2088,10 @@ syncookie_generate(struct syncache_head *sch, struct s cookie.flags.sack_ok = 1; /* Which of the two secrets to use. */ - secbit = sch->sch_sc->secret.oddeven & 0x1; + secbit = V_tcp_syncache.secret.oddeven & 0x1; cookie.flags.odd_even = secbit; - secbits = sch->sch_sc->secret.key[secbit]; + secbits = V_tcp_syncache.secret.key[secbit]; hash = syncookie_mac(&sc->sc_inc, sc->sc_irs, cookie.cookie, secbits, (uintptr_t)sch); @@ -2121,8 +2119,6 @@ syncookie_lookup(struct in_conninfo *inc, struct synca int wnd, wscale = 0; union syncookie cookie; - SCH_LOCK_ASSERT(sch); - /* * Pull information out of SYN-ACK/ACK and revert sequence number * advances. @@ -2137,7 +2133,7 @@ syncookie_lookup(struct in_conninfo *inc, struct synca cookie.cookie = (ack & 0xff) ^ (ack >> 24); /* Which of the two secrets to use. */ - secbits = sch->sch_sc->secret.key[cookie.flags.odd_even]; + secbits = V_tcp_syncache.secret.key[cookie.flags.odd_even]; hash = syncookie_mac(inc, seq, cookie.cookie, secbits, (uintptr_t)sch);