Add a sysctl, regression.sonewconn_earlytest, which when options
REGRESSION is enabled, allows user space to dictate that sonewconn() should skip it's "skip the hard work" check to see if the listen queue is full, and instead proceed with allocation of a socket and trimming of the overflowed queue. This makes it easier to test the queue overflow logic. MFC after: 1 month
This commit is contained in:
parent
d9949cb211
commit
63b01ffd34
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157158
@ -70,6 +70,12 @@ static u_long sb_max_adj =
|
||||
|
||||
static u_long sb_efficiency = 8; /* parameter for sbreserve() */
|
||||
|
||||
#ifdef REGRESSION
|
||||
static int regression_sonewconn_earlytest = 1;
|
||||
SYSCTL_INT(_regression, OID_AUTO, sonewconn_earlytest, CTLFLAG_RW,
|
||||
®ression_sonewconn_earlytest, 0, "Perform early sonewconn limit test");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Procedures to manipulate state flags of socket
|
||||
* and do appropriate wakeups. Normal sequence from the
|
||||
@ -215,7 +221,11 @@ sonewconn(head, connstatus)
|
||||
ACCEPT_LOCK();
|
||||
over = (head->so_qlen > 3 * head->so_qlimit / 2);
|
||||
ACCEPT_UNLOCK();
|
||||
#ifdef REGRESSION
|
||||
if (regression_sonewconn_earlytest && over)
|
||||
#else
|
||||
if (over)
|
||||
#endif
|
||||
return (NULL);
|
||||
so = soalloc(M_NOWAIT);
|
||||
if (so == NULL)
|
||||
|
@ -70,6 +70,12 @@ static u_long sb_max_adj =
|
||||
|
||||
static u_long sb_efficiency = 8; /* parameter for sbreserve() */
|
||||
|
||||
#ifdef REGRESSION
|
||||
static int regression_sonewconn_earlytest = 1;
|
||||
SYSCTL_INT(_regression, OID_AUTO, sonewconn_earlytest, CTLFLAG_RW,
|
||||
®ression_sonewconn_earlytest, 0, "Perform early sonewconn limit test");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Procedures to manipulate state flags of socket
|
||||
* and do appropriate wakeups. Normal sequence from the
|
||||
@ -215,7 +221,11 @@ sonewconn(head, connstatus)
|
||||
ACCEPT_LOCK();
|
||||
over = (head->so_qlen > 3 * head->so_qlimit / 2);
|
||||
ACCEPT_UNLOCK();
|
||||
#ifdef REGRESSION
|
||||
if (regression_sonewconn_earlytest && over)
|
||||
#else
|
||||
if (over)
|
||||
#endif
|
||||
return (NULL);
|
||||
so = soalloc(M_NOWAIT);
|
||||
if (so == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user