From owner-svn-src-head@freebsd.org Fri Jan 6 23:41:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18621CA31D7; Fri, 6 Jan 2017 23:41:47 +0000 (UTC) (envelope-from jhb@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 mx1.freebsd.org (Postfix) with ESMTPS id BA78A11C7; Fri, 6 Jan 2017 23:41:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v06NfjZ5054508; Fri, 6 Jan 2017 23:41:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v06NfjkL054505; Fri, 6 Jan 2017 23:41:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701062341.v06NfjkL054505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 6 Jan 2017 23:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311568 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 23:41:47 -0000 Author: jhb Date: Fri Jan 6 23:41:45 2017 New Revision: 311568 URL: https://svnweb.freebsd.org/changeset/base/311568 Log: Set MORETOCOME for AIO write requests on a socket. Add a MSG_MOREOTOCOME message flag. When this flag is set, sosend* set PRUS_MOREOTOCOME when invoking the protocol send method. The aio worker tasks for sending on a socket set this flag when there are additional write jobs waiting on the socket buffer. Reviewed by: adrian MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D8955 Modified: head/sys/kern/sys_socket.c head/sys/kern/uipc_socket.c head/sys/sys/socket.h Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Fri Jan 6 23:30:54 2017 (r311567) +++ head/sys/kern/sys_socket.c Fri Jan 6 23:41:45 2017 (r311568) @@ -604,6 +604,8 @@ retry: if (td->td_ru.ru_msgrcv != ru_before) job->msgrcv = 1; } else { + if (!TAILQ_EMPTY(&sb->sb_aiojobq)) + flags |= MSG_MORETOCOME; uio.uio_rw = UIO_WRITE; ru_before = td->td_ru.ru_msgsnd; #ifdef MAC Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Jan 6 23:30:54 2017 (r311567) +++ head/sys/kern/uipc_socket.c Fri Jan 6 23:41:45 2017 (r311568) @@ -1182,6 +1182,7 @@ sosend_dgram(struct socket *so, struct s (resid <= 0)) ? PRUS_EOF : /* If there is more to send set PRUS_MORETOCOME */ + (flags & MSG_MORETOCOME) || (resid > 0 && space > 0) ? PRUS_MORETOCOME : 0, top, addr, control, td); if (dontroute) { @@ -1368,6 +1369,7 @@ restart: (resid <= 0)) ? PRUS_EOF : /* If there is more to send set PRUS_MORETOCOME. */ + (flags & MSG_MORETOCOME) || (resid > 0 && space > 0) ? PRUS_MORETOCOME : 0, top, addr, control, td); if (dontroute) { Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Fri Jan 6 23:30:54 2017 (r311567) +++ head/sys/sys/socket.h Fri Jan 6 23:41:45 2017 (r311568) @@ -435,6 +435,7 @@ struct msghdr { #endif #ifdef _KERNEL #define MSG_SOCALLBCK 0x10000 /* for use by socket callbacks - soreceive (TCP) */ +#define MSG_MORETOCOME 0x20000 /* additional data pending */ #endif /*