svn commit: r356357 - in head: share/man/man4 sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Sat Jan 4 20:33:14 UTC 2020


Author: tuexen
Date: Sat Jan  4 20:33:12 2020
New Revision: 356357
URL: https://svnweb.freebsd.org/changeset/base/356357

Log:
  Make the message size limit used for SCTP_SENDALL configurable via
  a sysctl variable instead of a compiled in constant.
  
  This is based on a patch provided by nwhitehorn at .

Modified:
  head/share/man/man4/sctp.4
  head/sys/netinet/sctp.h
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_sysctl.c
  head/sys/netinet/sctp_sysctl.h

Modified: head/share/man/man4/sctp.4
==============================================================================
--- head/share/man/man4/sctp.4	Sat Jan  4 20:19:25 2020	(r356356)
+++ head/share/man/man4/sctp.4	Sat Jan  4 20:33:12 2020	(r356357)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 10, 2018
+.Dd January 4, 2020
 .Dt SCTP 4
 .Os
 .Sh NAME
@@ -472,6 +472,8 @@ Enable SCTP blackholing.
 See
 .Xr blackhole 4
 for more details.
+.It Va sendall_limit
+Maximum message size (in bytes) that can be transmitted with SCTP_SENDALL flags set.
 .It Va buffer_splitting
 Enable send/receive buffer splitting.
 .It Va vtag_time_wait

Modified: head/sys/netinet/sctp.h
==============================================================================
--- head/sys/netinet/sctp.h	Sat Jan  4 20:19:25 2020	(r356356)
+++ head/sys/netinet/sctp.h	Sat Jan  4 20:33:12 2020	(r356357)
@@ -491,7 +491,6 @@ struct sctp_error_auth_invalid_hmac {
 					 * time */
 #define SCTP_SAT_NETWORK_BURST_INCR  2	/* how many times to multiply maxburst
 					 * in sat */
-#define SCTP_MAX_SENDALL_LIMIT 1024
 
 /* Data Chuck Specific Flags */
 #define SCTP_DATA_FRAG_MASK        0x03

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Sat Jan  4 20:19:25 2020	(r356356)
+++ head/sys/netinet/sctp_output.c	Sat Jan  4 20:33:12 2020	(r356357)
@@ -6885,8 +6885,8 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, 
 		/* There is another. */
 		return (EBUSY);
 	}
-	if (uio->uio_resid > SCTP_MAX_SENDALL_LIMIT) {
-		/* You must be less than the max! */
+	if (uio->uio_resid > SCTP_BASE_SYSCTL(sctp_sendall_limit)) {
+		/* You must not be larger than the limit! */
 		return (EMSGSIZE);
 	}
 	SCTP_MALLOC(ca, struct sctp_copy_all *, sizeof(struct sctp_copy_all),

Modified: head/sys/netinet/sctp_sysctl.c
==============================================================================
--- head/sys/netinet/sctp_sysctl.c	Sat Jan  4 20:19:25 2020	(r356356)
+++ head/sys/netinet/sctp_sysctl.c	Sat Jan  4 20:33:12 2020	(r356357)
@@ -119,6 +119,7 @@ sctp_init_sysctls()
 	SCTP_BASE_SYSCTL(sctp_steady_step) = SCTPCTL_RTTVAR_STEADYS_DEFAULT;
 	SCTP_BASE_SYSCTL(sctp_use_dccc_ecn) = SCTPCTL_RTTVAR_DCCCECN_DEFAULT;
 	SCTP_BASE_SYSCTL(sctp_blackhole) = SCTPCTL_BLACKHOLE_DEFAULT;
+	SCTP_BASE_SYSCTL(sctp_sendall_limit) = SCTPCTL_SENDALL_LIMIT_DEFAULT;
 	SCTP_BASE_SYSCTL(sctp_diag_info_code) = SCTPCTL_DIAG_INFO_CODE_DEFAULT;
 #if defined(SCTP_LOCAL_TRACE_BUF)
 	memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log));
@@ -943,6 +944,7 @@ SCTP_UINT_SYSCTL(rttvar_eqret, sctp_rttvar_eqret, SCTP
 SCTP_UINT_SYSCTL(rttvar_steady_step, sctp_steady_step, SCTPCTL_RTTVAR_STEADYS)
 SCTP_UINT_SYSCTL(use_dcccecn, sctp_use_dccc_ecn, SCTPCTL_RTTVAR_DCCCECN)
 SCTP_UINT_SYSCTL(blackhole, sctp_blackhole, SCTPCTL_BLACKHOLE)
+SCTP_UINT_SYSCTL(sendall_limit, sctp_sendall_limit, SCTPCTL_SENDALL_LIMIT)
 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)

Modified: head/sys/netinet/sctp_sysctl.h
==============================================================================
--- head/sys/netinet/sctp_sysctl.h	Sat Jan  4 20:19:25 2020	(r356356)
+++ head/sys/netinet/sctp_sysctl.h	Sat Jan  4 20:33:12 2020	(r356357)
@@ -116,6 +116,7 @@ struct sctp_sysctl {
 	uint32_t sctp_buffer_splitting;
 	uint32_t sctp_initial_cwnd;
 	uint32_t sctp_blackhole;
+	uint32_t sctp_sendall_limit;
 #if defined(SCTP_DEBUG)
 	uint32_t sctp_debug_on;
 #endif
@@ -537,6 +538,12 @@ struct sctp_sysctl {
 #define SCTPCTL_BLACKHOLE_MIN		0
 #define SCTPCTL_BLACKHOLE_MAX		2
 #define SCTPCTL_BLACKHOLE_DEFAULT	SCTPCTL_BLACKHOLE_MIN
+
+/* sendall_limit: Maximum message with SCTP_SENDALL */
+#define SCTPCTL_SENDALL_LIMIT_DESC	"Maximum size of a message send with SCTP_SENDALL"
+#define SCTPCTL_SENDALL_LIMIT_MIN	0
+#define SCTPCTL_SENDALL_LIMIT_MAX	0xFFFFFFFF
+#define SCTPCTL_SENDALL_LIMIT_DEFAULT	1432
 
 #define SCTPCTL_DIAG_INFO_CODE_DESC	"Diagnostic information error cause code"
 #define SCTPCTL_DIAG_INFO_CODE_MIN	0


More information about the svn-src-head mailing list