From nobody Mon Nov 29 13:35:11 2021 X-Original-To: bugs@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 8D54218B91E8 for ; Mon, 29 Nov 2021 13:35:11 +0000 (UTC) (envelope-from bugzilla-noreply@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 4J2mYq1STVz4v6p for ; Mon, 29 Nov 2021 13:35:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 13714235A2 for ; Mon, 29 Nov 2021 13:35:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 1ATDZBa6007732 for ; Mon, 29 Nov 2021 13:35:11 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1ATDZB1F007731 for bugs@FreeBSD.org; Mon, 29 Nov 2021 13:35:11 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 260116] [sctp] POLLOUT/EVFILT_WRITE is always true for poll/kqueue Date: Mon, 29 Nov 2021 13:35:11 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: albin.hellqvist@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638192911; 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=Ucvnnf8njBTxIjJ5xf5L31aig0zPFujJqDMVihQ9BCA=; b=aiLtXAjnPTNLe+26Aaxde/biEufMYlH4jhnQTiBYaWSFSCdHHbzpKBeAiwCDRPH1qDr6/Y N+a6CT/ZZm+wCWKP0Z69/Yb1hTqUAXARkOanFF0gMq7tdXCEYhjSII2ENN6P7cjiPGgBJE o9Jw7wlGsJJbcF+9GzExCAl+Q0CpHsSXuHiK3Cs1vR1dyJFq47O6M58Ht2I0F2wFNKPkYB vQZxbqDaXIIbMhCyCLcrnL0ymzgyG0c4Hhm0LlN4IqJoYre4398VJ12vqqnMd2D/tp4dza JwJwEB94EoZ6Md7XAiryQoeppZKajcHnRoZzi6z+X4VAsmpvSJQCBg2ZpSToYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638192911; a=rsa-sha256; cv=none; b=Xae4XSdCkiE9JTf+JXfG8HpDKRLxvxonC8o6gppy1XNFwcB+N2tVJczecHJaeVrtz6n7I9 qeZVkd3j62QCYtGwNL7GE5RdthNcOj7YG+vr3rT0bVntPtOkRmFRCmFXoIXIpm7JMA0w5Z KY7N0u45GMCC5s7OB699SvqIwspoOKI5Y1H1w8jPwDmVJ9dGYc2tNxRlFRP/gLby5ajUhE bZFxdiXo97zNvHX9or8dmFNCCXE7Os2aX8cJ7pJciRuW+p6XFuP6q9V78A1Z1lHjKqe2Oz pMeVN62UGQS4eoKlvyWzjMBTR9CSc4DKYAAm/jVGfPtGsqli/GqbUFf8A0kZrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260116 Bug ID: 260116 Summary: [sctp] POLLOUT/EVFILT_WRITE is always true for poll/kqueue Product: Base System Version: 13.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: albin.hellqvist@gmail.com It seems like POLLOUT/EVFILT_WRITE always is true for SCTP sockets even if = the socket send buffer is full. Besides this, it should also account for SO_SNDLOWAT but it is possible tha= t we will get this for "free" since it looks like the functionality already is there. Based on some experiments (which might be faulty), SCTP sockets doesn't use struct sockbuf in the same way as TCP uses it. A lot of the fields in that struct are 0 for SCTP sockets since it also has its own structs. This seems to affect filt_sowrite() in (https://github.com/freebsd/freebsd-src/blob/main/sys/kern/uipc_socket.c). = More specifically, this line: kn->kn_data =3D sbspace(&so->so_snd); I have tested to replace that line with: kn->kn_data =3D (so->so_snd.sb_hiwat - so->so_snd.sb_acc); Which seems to do the trick, but I expect this to have side effects. --=20 You are receiving this mail because: You are the assignee for the bug.=