From owner-svn-src-all@freebsd.org Sun Jun 7 14:39:22 2020 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 8ADA832D626; Sun, 7 Jun 2020 14:39:22 +0000 (UTC) (envelope-from tuexen@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49fzY63C5Mz3dvQ; Sun, 7 Jun 2020 14:39:22 +0000 (UTC) (envelope-from tuexen@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 669B414B39; Sun, 7 Jun 2020 14:39:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 057EdMBK033086; Sun, 7 Jun 2020 14:39:22 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 057EdK1i033076; Sun, 7 Jun 2020 14:39:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202006071439.057EdK1i033076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 7 Jun 2020 14:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361895 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 361895 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.33 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: Sun, 07 Jun 2020 14:39:22 -0000 Author: tuexen Date: Sun Jun 7 14:39:20 2020 New Revision: 361895 URL: https://svnweb.freebsd.org/changeset/base/361895 Log: Retire SCTP_SO_LOCK_TESTING. This was intended to test the locking used in the MacOS X kernel on a FreeBSD system, to make use of WITNESS and other debugging infrastructure. This hasn't been used for ages, to take it out to reduce the #ifdef complexity. MFC after: 1 week Modified: head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Sun Jun 7 13:53:23 2020 (r361894) +++ head/sys/netinet/sctp_auth.c Sun Jun 7 14:39:20 2020 (r361895) @@ -566,9 +566,7 @@ sctp_auth_key_acquire(struct sctp_tcb *stcb, uint16_t void sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { sctp_sharedkey_t *skey; @@ -1721,9 +1719,7 @@ sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_au void sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, uint16_t keyid, uint16_t alt_keyid, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { struct mbuf *m_notify; Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sun Jun 7 13:53:23 2020 (r361894) +++ head/sys/netinet/sctp_constants.h Sun Jun 7 14:39:20 2020 (r361895) @@ -943,7 +943,7 @@ __FBSDID("$FreeBSD$"); /*- * defines for socket lock states. - * Used by __APPLE__ and SCTP_SO_LOCK_TESTING + * Used by __APPLE__ */ #define SCTP_SO_LOCKED 1 #define SCTP_SO_NOT_LOCKED 0 Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Jun 7 13:53:23 2020 (r361894) +++ head/sys/netinet/sctp_indata.c Sun Jun 7 14:39:20 2020 (r361895) @@ -555,20 +555,6 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, sctp_ucount_incr(asoc->cnt_on_all_streams); nxt_todel = strm->last_mid_delivered + 1; if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid)) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; - - so = SCTP_INP_SO(stcb->sctp_ep); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - SCTP_SOCKET_UNLOCK(so, 1); - return; - } -#endif /* can be delivered right away? */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_STR_LOGGING_ENABLE) { sctp_log_strm_del(control, NULL, SCTP_STR_LOG_FROM_IMMED_DEL); @@ -638,9 +624,6 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, } break; } -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } if (queue_needed) { /* @@ -1956,25 +1939,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc */ if (stcb->sctp_socket->so_rcv.sb_cc) { /* some to read, wake-up */ -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; - - so = SCTP_INP_SO(stcb->sctp_ep); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - /* assoc was freed while we were unlocked */ - SCTP_SOCKET_UNLOCK(so, 1); - return (0); - } -#endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } /* now is it in the mapping array of what we have accepted? */ if (chk_type == SCTP_DATA) { @@ -4182,32 +4147,12 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 } /* sa_ignore NO_NULL_CHK */ if (stcb->sctp_socket) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; - -#endif SOCKBUF_LOCK(&stcb->sctp_socket->so_snd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { /* sa_ignore NO_NULL_CHK */ sctp_wakeup_log(stcb, 1, SCTP_WAKESND_FROM_SACK); } -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - /* assoc was freed while we were unlocked */ - SCTP_SOCKET_UNLOCK(so, 1); - return; - } -#endif sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { sctp_wakeup_log(stcb, 1, SCTP_NOWAKE_FROM_SACK); @@ -4894,31 +4839,11 @@ hopeless_peer: /* sa_ignore NO_NULL_CHK */ if ((wake_him) && (stcb->sctp_socket)) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; - -#endif SOCKBUF_LOCK(&stcb->sctp_socket->so_snd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { sctp_wakeup_log(stcb, wake_him, SCTP_WAKESND_FROM_SACK); } -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - /* assoc was freed while we were unlocked */ - SCTP_SOCKET_UNLOCK(so, 1); - return; - } -#endif sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { sctp_wakeup_log(stcb, wake_him, SCTP_NOWAKE_FROM_SACK); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Jun 7 13:53:23 2020 (r361894) +++ head/sys/netinet/sctp_input.c Sun Jun 7 14:39:20 2020 (r361895) @@ -214,9 +214,7 @@ outnow: int sctp_is_there_unsent_data(struct sctp_tcb *stcb, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { int unsent_data; @@ -788,9 +786,6 @@ static int sctp_handle_abort(struct sctp_abort_chunk *abort, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; -#endif uint16_t len; uint16_t error; @@ -838,20 +833,9 @@ sctp_handle_abort(struct sctp_abort_chunk *abort, #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); #endif -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_WAS_ABORTED); (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_8); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_abort: finished\n"); return (1); } @@ -892,9 +876,6 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, struct sctp_association *asoc; int some_on_streamwheel; int old_state; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; -#endif SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown: handling SHUTDOWN\n"); @@ -943,25 +924,9 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; SCTP_INP_READ_UNLOCK(stcb->sctp_ep); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - /* assoc was freed while we were unlocked */ - SCTP_SOCKET_UNLOCK(so, 1); - return; - } -#endif if (stcb->sctp_socket) { sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); } -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } /* goto SHUTDOWN_RECEIVED state to block new requests */ if (stcb->sctp_socket) { @@ -1021,11 +986,7 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chun struct sctp_nets *net) { struct sctp_association *asoc; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; - so = SCTP_INP_SO(stcb->sctp_ep); -#endif SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_ack: handling SHUTDOWN ACK\n"); if (stcb == NULL) @@ -1055,22 +1016,7 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chun asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; SCTP_INP_READ_UNLOCK(stcb->sctp_ep); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - /* assoc was freed while we were unlocked */ - SCTP_SOCKET_UNLOCK(so, 1); - return; - } -#endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } #ifdef INVARIANTS if (!TAILQ_EMPTY(&asoc->send_queue) || @@ -1094,18 +1040,8 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chun } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); /* free the TCB but first save off the ep */ -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_11); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } static void @@ -1176,9 +1112,6 @@ sctp_handle_error(struct sctp_chunkhdr *ch, struct sctp_association *asoc; uint32_t remaining_length, adjust; uint16_t code, cause_code, cause_length; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; -#endif /* parse through all of the errors and process */ asoc = &stcb->asoc; @@ -1252,19 +1185,8 @@ sctp_handle_error(struct sctp_chunkhdr *ch, asoc->max_init_times) { sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); /* now free the asoc */ -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_12); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif return (-1); } /* blast back to INIT state */ @@ -1648,9 +1570,6 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && (!SCTP_IS_LISTENING(inp))) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; -#endif /* * Here is where collision would go if we * did a connect() and instead got a @@ -1659,22 +1578,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle */ stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_add_int(&stcb->asoc.refcnt, -1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - SCTP_SOCKET_UNLOCK(so, 1); - return (NULL); - } -#endif soisconnected(stcb->sctp_socket); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } /* notify upper layer */ *notification = SCTP_NOTIFY_ASSOC_UP; @@ -1849,27 +1753,9 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && (!SCTP_IS_LISTENING(inp))) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; -#endif stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_add_int(&stcb->asoc.refcnt, -1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - SCTP_SOCKET_UNLOCK(so, 1); - return (NULL); - } -#endif soisconnected(stcb->sctp_socket); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) SCTP_STAT_INCR_COUNTER32(sctps_activeestab); @@ -1910,9 +1796,6 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle cookie->tie_tag_peer_vtag == asoc->peer_vtag_nonce && cookie->tie_tag_peer_vtag != 0) { struct sctpasochead *head; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; -#endif if (asoc->peer_supports_nat) { /* @@ -1980,10 +1863,6 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle asoc->mapping_array_size); } SCTP_TCB_UNLOCK(stcb); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - SCTP_SOCKET_LOCK(so, 1); -#endif SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(stcb->sctp_ep); SCTP_TCB_LOCK(stcb); @@ -2026,9 +1905,6 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle SCTP_TCB_SEND_UNLOCK(stcb); SCTP_INP_WUNLOCK(stcb->sctp_ep); SCTP_INP_INFO_WUNLOCK(); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif asoc->total_flight = 0; asoc->total_flight_count = 0; /* process the INIT info (peer's info) */ @@ -2095,12 +1971,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in int retval; int error = 0; uint8_t auth_chunk_buf[SCTP_CHUNK_BUFFER_SIZE]; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; - so = SCTP_INP_SO(inp); -#endif - /* * find and validate the INIT chunk in the cookie (peer's info) the * INIT should start after the cookie-echo header struct (chunk @@ -2199,18 +2070,8 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in src, dst, sh, op_err, mflowtype, mflowid, vrf_id, port); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_18); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif return (NULL); } /* process the INIT-ACK info (my info) */ @@ -2231,36 +2092,16 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in else retval = 0; if (retval < 0) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif return (NULL); } /* load all addresses */ if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, src, dst, init_src, port)) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_20); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif return (NULL); } /* @@ -2282,18 +2123,8 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in /* auth HMAC failed, dump the assoc and packet */ SCTPDBG(SCTP_DEBUG_AUTH1, "COOKIE-ECHO: AUTH failed\n"); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_21); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif return (NULL); } else { /* remaining chunks checked... good to go */ @@ -2333,18 +2164,8 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in break; #endif default: -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_22); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif return (NULL); } @@ -2373,21 +2194,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in * a bit of protection is worth having.. */ stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - SCTP_SOCKET_UNLOCK(so, 1); - return (NULL); - } -#endif soisconnected(stcb->sctp_socket); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } else if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (SCTP_IS_LISTENING(inp))) { /* @@ -2807,9 +2614,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in if (so == NULL) { struct mbuf *op_err; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *pcb_so; -#endif + /* Too many sockets */ SCTPDBG(SCTP_DEBUG_INPUT1, "process_cookie_new: no room for another socket!\n"); op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); @@ -2817,19 +2622,8 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in src, dst, sh, op_err, mflowtype, mflowid, vrf_id, port); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - pcb_so = SCTP_INP_SO(*inp_p); - atomic_add_int(&(*stcb)->asoc.refcnt, 1); - SCTP_TCB_UNLOCK((*stcb)); - SCTP_SOCKET_LOCK(pcb_so, 1); - SCTP_TCB_LOCK((*stcb)); - atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(*inp_p, *stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_23); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(pcb_so, 1); -#endif return (NULL); } inp = (struct sctp_inpcb *)so->so_pcb; @@ -2926,17 +2720,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in * Pull it from the incomplete queue and wake the * guy */ -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - atomic_add_int(&(*stcb)->asoc.refcnt, 1); - SCTP_TCB_UNLOCK((*stcb)); - SCTP_SOCKET_LOCK(so, 1); -#endif soisconnected(so); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_TCB_LOCK((*stcb)); - atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); - SCTP_SOCKET_UNLOCK(so, 1); -#endif return (m); } } @@ -2996,25 +2780,10 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; - -#endif stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif if ((stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) == 0) { soisconnected(stcb->sctp_socket); } -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } /* * since we did not send a HB make sure we don't double @@ -3238,9 +3007,6 @@ static void sctp_handle_shutdown_complete(struct sctp_shutdown_complete_chunk *cp SCTP_UNUSED, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; -#endif SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_complete: handling SHUTDOWN-COMPLETE\n"); @@ -3273,19 +3039,8 @@ sctp_handle_shutdown_complete(struct sctp_shutdown_com /* free the TCB */ SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_complete: calls free-asoc\n"); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_25); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif return; } @@ -4570,9 +4325,6 @@ sctp_process_control(struct mbuf *m, int iphlen, int * uint32_t auth_offset = 0, auth_len = 0; int auth_skipped = 0; int asconf_cnt = 0; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; -#endif SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_control: iphlen=%u, offset=%u, length=%u stcb:%p\n", iphlen, *offset, length, (void *)stcb); @@ -4881,19 +4633,8 @@ process_control_chunks: } else { *offset = length; if (stcb != NULL) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(inp); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_29); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif } return (NULL); } @@ -5245,19 +4986,8 @@ process_control_chunks: if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else if (stcb) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(inp); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_30); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif *offset = length; return (NULL); } @@ -5360,19 +5090,8 @@ process_control_chunks: *fwd_tsn_seen = 1; if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(inp); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_31); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif *offset = length; return (NULL); } Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jun 7 13:53:23 2020 (r361894) +++ head/sys/netinet/sctp_output.c Sun Jun 7 14:39:20 2020 (r361895) @@ -3990,11 +3990,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, uint16_t port, union sctp_sockstore *over_addr, uint8_t mflowtype, uint32_t mflowid, -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) int so_locked SCTP_UNUSED -#else - int so_locked -#endif ) { /* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ @@ -4024,9 +4020,6 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, struct udphdr *udp = NULL; #endif uint8_t tos_value; -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so = NULL; -#endif if ((net) && (net->dest_state & SCTP_ADDR_OUT_OF_SCOPE)) { SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EFAULT); @@ -4247,23 +4240,8 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, sctp_packet_log(o_pak); #endif /* send it out. table id is taken from stcb */ -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { - so = SCTP_INP_SO(inp); - SCTP_SOCKET_UNLOCK(so, 0); - } -#endif SCTP_PROBE5(send, NULL, stcb, ip, stcb, sctphdr); SCTP_IP_OUTPUT(ret, o_pak, ro, stcb, vrf_id); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 0); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - } -#endif if (port) { UDPSTAT_INC(udps_opackets); } @@ -4582,27 +4560,12 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, SCTP_STAT_INCR(sctps_sendhwcrc); } /* send it out. table id is taken from stcb */ -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { - so = SCTP_INP_SO(inp); - SCTP_SOCKET_UNLOCK(so, 0); - } -#endif #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) sctp_packet_log(o_pak); #endif SCTP_PROBE5(send, NULL, stcb, ip6h, stcb, sctphdr); SCTP_IP6_OUTPUT(ret, o_pak, (struct route_in6 *)ro, &ifp, stcb, vrf_id); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 0); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - } -#endif if (net) { /* for link local this must be done */ sin6->sin6_scope_id = prev_scope; @@ -4674,9 +4637,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, void sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { struct mbuf *m, *m_last; @@ -6612,9 +6573,7 @@ sctp_med_chunk_output(struct sctp_inpcb *inp, int *reason_code, int control_only, int from_where, struct timeval *now, int *now_filled, int frag_point, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ); static void @@ -7076,9 +7035,7 @@ all_done: static void sctp_clean_up_ctl(struct sctp_tcb *stcb, struct sctp_association *asoc, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { struct sctp_tmit_chunk *chk, *nchk; @@ -7185,9 +7142,7 @@ sctp_move_to_outqueue(struct sctp_tcb *stcb, int eeor_mode, int *bail, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { /* Move from the stream to the send_queue keeping track of the total */ @@ -7716,9 +7671,7 @@ out_of: static void sctp_fill_outqueue(struct sctp_tcb *stcb, struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { struct sctp_association *asoc; @@ -7839,9 +7792,7 @@ sctp_med_chunk_output(struct sctp_inpcb *inp, int *reason_code, int control_only, int from_where, struct timeval *now, int *now_filled, int frag_point, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { /** @@ -9458,9 +9409,7 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_association *asoc, int *cnt_out, struct timeval *now, int *now_filled, int *fr_done, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { /*- @@ -10011,9 +9960,7 @@ sctp_chunk_output(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_where, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { /*- @@ -10532,9 +10479,7 @@ sctp_fill_in_rest: void sctp_send_sack(struct sctp_tcb *stcb, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { /*- @@ -10930,9 +10875,7 @@ sctp_send_sack(struct sctp_tcb *stcb, int so_locked void sctp_send_abort_tcb(struct sctp_tcb *stcb, struct mbuf *operr, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { struct mbuf *m_abort, *m, *m_last; @@ -11350,9 +11293,7 @@ sctp_send_shutdown_complete2(struct sockaddr *src, str void sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ) { struct sctp_tmit_chunk *chk; Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sun Jun 7 13:53:23 2020 (r361894) +++ head/sys/netinet/sctp_output.h Sun Jun 7 14:39:20 2020 (r361895) @@ -76,9 +76,7 @@ int void sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ); void @@ -148,15 +146,11 @@ sctp_output(struct sctp_inpcb *, struct mbuf *, struct void sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ); void sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *, int -#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED -#endif ); void send_forward_tsn(struct sctp_tcb *, struct sctp_association *); Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sun Jun 7 13:53:23 2020 (r361894) +++ head/sys/netinet/sctp_sysctl.c Sun Jun 7 14:39:20 2020 (r361895) @@ -130,9 +130,6 @@ sctp_init_sysctls() #if defined(SCTP_DEBUG) SCTP_BASE_SYSCTL(sctp_debug_on) = SCTPCTL_DEBUG_DEFAULT; #endif -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_BASE_SYSCTL(sctp_output_unlocked) = SCTPCTL_OUTPUT_UNLOCKED_DEFAULT; -#endif } @@ -958,9 +955,6 @@ SCTP_UINT_SYSCTL(sendall_limit, sctp_sendall_limit, SC SCTP_UINT_SYSCTL(diag_info_code, sctp_diag_info_code, SCTPCTL_DIAG_INFO_CODE) #ifdef SCTP_DEBUG SCTP_UINT_SYSCTL(debug, sctp_debug_on, SCTPCTL_DEBUG) -#endif -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) -SCTP_UINT_SYSCTL(output_unlocked, sctp_output_unlocked, SCTPCTL_OUTPUT_UNLOCKED) #endif SYSCTL_PROC(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sun Jun 7 13:53:23 2020 (r361894) +++ head/sys/netinet/sctp_sysctl.h Sun Jun 7 14:39:20 2020 (r361895) @@ -120,9 +120,6 @@ struct sctp_sysctl { #if defined(SCTP_DEBUG) uint32_t sctp_debug_on; #endif -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - uint32_t sctp_output_unlocked; -#endif }; /* @@ -559,12 +556,6 @@ struct sctp_sysctl { #endif -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) -#define SCTPCTL_OUTPUT_UNLOCKED_DESC "Unlock socket when sending packets down to IP" -#define SCTPCTL_OUTPUT_UNLOCKED_MIN 0 -#define SCTPCTL_OUTPUT_UNLOCKED_MAX 1 -#define SCTPCTL_OUTPUT_UNLOCKED_DEFAULT SCTPCTL_OUTPUT_UNLOCKED_MIN -#endif #if defined(_KERNEL) || defined(__Userspace__) Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Jun 7 13:53:23 2020 (r361894) +++ head/sys/netinet/sctp_usrreq.c Sun Jun 7 14:39:20 2020 (r361895) @@ -162,9 +162,6 @@ sctp_notify(struct sctp_inpcb *inp, uint16_t ip_len, uint32_t next_mtu) { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; -#endif int timer_stopped; if (icmp_type != ICMP_UNREACH) { @@ -194,20 +191,8 @@ sctp_notify(struct sctp_inpcb *inp, (icmp_code == ICMP_UNREACH_PORT)) { /* Treat it like an ABORT. */ sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(inp); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***