From nobody Tue Aug 22 18:38:43 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 4RVdQq3Wmxz4qGKh; Tue, 22 Aug 2023 18:38:43 +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 4RVdQq2wDbz3Sgp; Tue, 22 Aug 2023 18:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692729523; 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=P4FOF5e2pau3t0Flz+vhM8WN3LNhJUbCOgYK/UloJiA=; b=Ualendo5IjcjWLu0TXKC+nAGQ+EolsXJYAfWRJ+rilTM4lgoG3d8+GIBxKY7g4QBfMvzEw s2bkO9KUSdSlxFwnkuxXFZ9PQEXyIObAHYnjTAPlpWa5M5WlDhCeqU3m1Ou7hJRUdoyCMN I2Pr06+DCZhiQbvqEcrB65DGOatkP0RCKVkPO7MVHEtVwJ0QZVfH7b6IJ26q5CtSiMR2wa kHosBnKDI/xYoQ9gxIRLkhksApKiXPjG16p3QxXYEhzqRAYU2Oy2Sd3ZcD8Z2Skm7Zhcsp XKJ0prFImtRokIE3ny/gSO1qZ5LQyNFiJ950BilmYzmZ0ggCfqUgl3kiXrKwDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692729523; 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=P4FOF5e2pau3t0Flz+vhM8WN3LNhJUbCOgYK/UloJiA=; b=yFjPhxN87zzfnfwJ+8Y/JUrz4DuqaRt5z02KRDE5SVgnVQP7M2YKwfvEN3GcjBdtEUhP0F ngaaXR3rdOUX8rhpIR3R3PrFQnjxRvEtzlnrhOpMsOmdDE3pAi+F3UXorRdl5ftSvhX0Mp afslkLx6e6G5hsO5sjYtUkf+Z/jh5RtknOe7QYGIkwaJRxXO/XV7PoJScwCruT6+5j57Xc eszxFX+H2LLs7jF+0b7gakMdKe+eVMHErpLeAFWFgg9uGY+d7hkepFrY3ARPNO3H9I1O2z h+/I3rHYAqHw9YZ4ytbQiqnH8SM4iZ+DzHsc2R3bf7w/yLrhqGzKzBDKsEE9TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692729523; a=rsa-sha256; cv=none; b=hAJufY45VJ22C/vTdKZ3PZPQcemo/hU9fetkZw4ZROCKe7mRXB3VsJdHYTAOG3MT3Qudya 3zp+H3S77pg2Lud/YhrCTdqzhaGTB2Om8+b++tEr24uSoRCJjU0eD4U8V+f2HVjwsKLAMy 21cwaQrgv3oe00HsRz+jzjUkXKg9VjQgNwH3tgvngQFYhKpq6DMCNKZD9t8sUMaxOltfsv ogkYQ2JNfYp7g2SZBP7uec6307n7JJK840FQY4Tj+ETJ6XIwRyxZsXtAJiS+u1TVPuk6qu qilKz6hdCiVhBRFoULUBAtfzZKy1E9ckMVMe29ejsRO10MwNKaFI0nx75FARzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RVdQq1rsBz1Cg3; Tue, 22 Aug 2023 18:38:43 +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 37MIchfp034159; Tue, 22 Aug 2023 18:38:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37MIchYA034156; Tue, 22 Aug 2023 18:38:43 GMT (envelope-from git) Date: Tue, 22 Aug 2023 18:38:43 GMT Message-Id: <202308221838.37MIchYA034156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 8c6104c48ea3 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 8c6104c48ea3f0ffaabeb9784b0f2327db04e7af Auto-Submitted: auto-generated The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=8c6104c48ea3f0ffaabeb9784b0f2327db04e7af commit 8c6104c48ea3f0ffaabeb9784b0f2327db04e7af Author: Marius Strobl AuthorDate: 2023-08-22 17:03:42 +0000 Commit: Marius Strobl CommitDate: 2023-08-22 18:33:49 +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) --- 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 cb2131a4c0c2..c5a7e9290666 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -810,12 +810,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(tptoinpcb(tp)); + INP_LOCK_ASSERT(tptoinpcb(tp)); 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 0a37d0a8ba30..6a362484d46f 100644 --- a/sys/netinet/tcp_offload.c +++ b/sys/netinet/tcp_offload.c @@ -186,12 +186,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(tptoinpcb(tp)); + INP_LOCK_ASSERT(tptoinpcb(tp)); tod->tod_tcp_info(tod, tp, ti); } diff --git a/sys/netinet/tcp_offload.h b/sys/netinet/tcp_offload.h index 2524a56d0369..b397336ab487 100644 --- a/sys/netinet/tcp_offload.h +++ b/sys/netinet/tcp_offload.h @@ -45,7 +45,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 *); void tcp_offload_pmtu_update(struct tcpcb *, tcp_seq, int); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 811dfbaa51bd..a6101bc422f7 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -125,7 +125,7 @@ static int tcp6_connect(struct tcpcb *, struct sockaddr_in6 *, #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); @@ -1538,11 +1538,11 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr_in6 *sin6, struct thread *td) * 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(tptoinpcb(tp)); + INP_LOCK_ASSERT(tptoinpcb(tp)); bzero(ti, sizeof(*ti)); ti->tcpi_state = tp->t_state; diff --git a/sys/netinet/toecore.c b/sys/netinet/toecore.c index 5f5863431dfe..76aadad9a3b9 100644 --- a/sys/netinet/toecore.c +++ b/sys/netinet/toecore.c @@ -183,7 +183,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 746d21c138f0..a8e5afd6b50a 100644 --- a/sys/netinet/toecore.h +++ b/sys/netinet/toecore.h @@ -107,7 +107,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 */