From nobody Sat Jan 06 19:25:30 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 4T6qzZ56C0z571FB; Sat, 6 Jan 2024 19:25:30 +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 4T6qzZ4Xqcz3ww3; Sat, 6 Jan 2024 19:25:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704569130; 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=BKM2GEP5IltrgdZ8vmwt4G8TxoN1wAM4vHk84OLYXjs=; b=iHG7dBSH9i+bUDoHEixodnNQ1aigCZ9uk28/6tzFHTLO+0H1qFScm4Vs/5GtOlOAMFCVvh /sIzJXb67P7wdbH4QMxMCmESRd8NGbt3rrwE9Q8iO7fPzQbDeUV6Jn+YXA57HiRvCc/OqJ wh1xomRA7VpHKz8tRBFd+Yvi4ZiDHzKsSZsXz/7je3QGq1kvW9b2tnRG+CbnyssKDwrTI/ zzE1+COefTZ9qg2o5YsrbSq0xwfhbpokGIP9dOFQTG7tLYxMGQAhEoHemSvIh1c166xqHE eaV7dbMJYQbp3OF2j7lLOFzwB0BQseFa1JAJEnNUzV1YEc0Eb19iC+g2XTUYhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704569130; 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=BKM2GEP5IltrgdZ8vmwt4G8TxoN1wAM4vHk84OLYXjs=; b=e0WEy9D7zEdh9Gz6/HKwSS4wYBOrXJeoua1Gpe/rvrh9lXapwxexq44iKrzEfFD066lGgA DMNKD3kyg+hA/Nqy94b4R9TwnmWOFG/px0KnwBYqrminC1PZNmSXGsikmerjgWQAe5TqDH aKzZERz548JjlTj3HT0FYzSo0iARsBPRw/4QtT26M8Q1/5SfUq2hNjsICOwIyyTatxSoyM vIHolRktxyTN6Doje8qgiHT5hpB61F65G0gqAjVcUZRZehtrrngvRbTRKUHTz30xwMZ7gV bl09EM40telxuKIcK7f9s/w02jAx3PVbN/CigIEwy54PQ7SR5dxCWzDXN3jIiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704569130; a=rsa-sha256; cv=none; b=ukhE+CbPn+p1Js6AUx67YjEEzPPo+JQkXmYnlYxo5+fKoOG58xRwxxP1pAJxAdhRAZYWAi gru1C7b2HfDzjP23qJjq0lwuadCnd3Zd6Tuq3tTQ+hseSmVRLQeZ8FllP6ubWkw1AgbasZ QrL8y5T/01MvgScVBnPAogdelWNDapOspXy6CUXouUUSlgt+PtpHtJy/sAVBfAghNTEW12 FXhTzhg5QXy9K0kDaJRMlh36YyQR+6DJC8DF9v8aYjQOYThA9g1lt39qVzws/Cfnq0sKOX T5HWR1ssUx9bBI+lIK1kFYEBBtYsVbI176U1g9mClY+LHv0f0XWJ5NTgy78xgA== 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 4T6qzZ0wHGzth9; Sat, 6 Jan 2024 19:25:30 +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 406JPUiV065101; Sat, 6 Jan 2024 19:25:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 406JPUj7065098; Sat, 6 Jan 2024 19:25:30 GMT (envelope-from git) Date: Sat, 6 Jan 2024 19:25:30 GMT Message-Id: <202401061925.406JPUj7065098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marius Strobl Subject: git: bc85442bf6c9 - stable/13 - tcp_fill_info(): Change lock assertion on INPCB to locked only 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: marius X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bc85442bf6c9effcea7d7ef24651998b35c04dc9 Auto-Submitted: auto-generated The branch stable/13 has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=bc85442bf6c9effcea7d7ef24651998b35c04dc9 commit bc85442bf6c9effcea7d7ef24651998b35c04dc9 Author: Marius Strobl AuthorDate: 2023-08-22 17:03:42 +0000 Commit: Marius Strobl CommitDate: 2024-01-05 22:48:34 +0000 tcp_fill_info(): Change lock assertion on INPCB to locked only This function actually only ever reads from the TCP PCB. Consequently, also make the pointer to its TCP PCB parameter const. Sponsored by: NetApp, Inc. (originally) (cherry picked from commit 8c6104c48ea3f0ffaabeb9784b0f2327db04e7af) Conflicts (due tue missing 9eb0e832): sys/dev/cxgbe/tom/t4_tom.c sys/netinet/tcp_offload.c sys/netinet/tcp_usrreq.c --- sys/dev/cxgbe/tom/t4_tom.c | 4 ++-- sys/netinet/tcp_offload.c | 4 ++-- sys/netinet/tcp_offload.h | 2 +- sys/netinet/tcp_usrreq.c | 8 ++++---- sys/netinet/toecore.c | 2 +- sys/netinet/toecore.h | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index c423ca011977..b1982341f4d5 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -817,12 +817,12 @@ fill_tcp_info(struct adapter *sc, u_int tid, struct tcp_info *ti) * the tcp_info for an offloaded connection. */ static void -t4_tcp_info(struct toedev *tod, struct tcpcb *tp, struct tcp_info *ti) +t4_tcp_info(struct toedev *tod, const struct tcpcb *tp, struct tcp_info *ti) { struct adapter *sc = tod->tod_softc; struct toepcb *toep = tp->t_toe; - INP_WLOCK_ASSERT(tp->t_inpcb); + INP_LOCK_ASSERT(tp->t_inpcb); MPASS(ti != NULL); fill_tcp_info(sc, toep->tid, ti); diff --git a/sys/netinet/tcp_offload.c b/sys/netinet/tcp_offload.c index 71a5d51b5f22..b04251712580 100644 --- a/sys/netinet/tcp_offload.c +++ b/sys/netinet/tcp_offload.c @@ -185,12 +185,12 @@ tcp_offload_ctloutput(struct tcpcb *tp, int sopt_dir, int sopt_name) } void -tcp_offload_tcp_info(struct tcpcb *tp, struct tcp_info *ti) +tcp_offload_tcp_info(const struct tcpcb *tp, struct tcp_info *ti) { struct toedev *tod = tp->tod; KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); - INP_WLOCK_ASSERT(tp->t_inpcb); + INP_LOCK_ASSERT(tp->t_inpcb); tod->tod_tcp_info(tod, tp, ti); } diff --git a/sys/netinet/tcp_offload.h b/sys/netinet/tcp_offload.h index 855c28e01385..8f299f57fd33 100644 --- a/sys/netinet/tcp_offload.h +++ b/sys/netinet/tcp_offload.h @@ -43,7 +43,7 @@ void tcp_offload_input(struct tcpcb *, struct mbuf *); int tcp_offload_output(struct tcpcb *); void tcp_offload_rcvd(struct tcpcb *); void tcp_offload_ctloutput(struct tcpcb *, int, int); -void tcp_offload_tcp_info(struct tcpcb *, struct tcp_info *); +void tcp_offload_tcp_info(const struct tcpcb *, struct tcp_info *); int tcp_offload_alloc_tls_session(struct tcpcb *, struct ktls_session *, int); void tcp_offload_detach(struct tcpcb *); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index df322b03a59a..7e9c871df87a 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -129,7 +129,7 @@ static int tcp6_connect(struct tcpcb *, struct sockaddr *, #endif /* INET6 */ static void tcp_disconnect(struct tcpcb *); static void tcp_usrclosed(struct tcpcb *); -static void tcp_fill_info(struct tcpcb *, struct tcp_info *); +static void tcp_fill_info(const struct tcpcb *, struct tcp_info *); static int tcp_pru_options_support(struct tcpcb *tp, int flags); @@ -1631,11 +1631,11 @@ out: * constants -- for example, the numeric values for tcpi_state will differ * from Linux. */ -static void -tcp_fill_info(struct tcpcb *tp, struct tcp_info *ti) +void +tcp_fill_info(const struct tcpcb *tp, struct tcp_info *ti) { - INP_WLOCK_ASSERT(tp->t_inpcb); + INP_LOCK_ASSERT(tp->t_inpcb); bzero(ti, sizeof(*ti)); ti->tcpi_state = tp->t_state; diff --git a/sys/netinet/toecore.c b/sys/netinet/toecore.c index 7ccff2c3eeed..4bb5f706de06 100644 --- a/sys/netinet/toecore.c +++ b/sys/netinet/toecore.c @@ -182,7 +182,7 @@ toedev_ctloutput(struct toedev *tod __unused, struct tcpcb *tp __unused, } static void -toedev_tcp_info(struct toedev *tod __unused, struct tcpcb *tp __unused, +toedev_tcp_info(struct toedev *tod __unused, const struct tcpcb *tp __unused, struct tcp_info *ti __unused) { diff --git a/sys/netinet/toecore.h b/sys/netinet/toecore.h index 8a25a95799d5..6523c3a110fc 100644 --- a/sys/netinet/toecore.h +++ b/sys/netinet/toecore.h @@ -106,7 +106,7 @@ struct toedev { void (*tod_ctloutput)(struct toedev *, struct tcpcb *, int, int); /* Update software state */ - void (*tod_tcp_info)(struct toedev *, struct tcpcb *, + void (*tod_tcp_info)(struct toedev *, const struct tcpcb *, struct tcp_info *); /* Create a TLS session */