From owner-cvs-src@FreeBSD.ORG Mon Jan 22 15:54:59 2007 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F91516A405; Mon, 22 Jan 2007 15:54:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 5A2CD13C4A6; Mon, 22 Jan 2007 15:54:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id l0MFsJ2l099205; Mon, 22 Jan 2007 10:54:50 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Andre Oppermann Date: Mon, 22 Jan 2007 10:54:33 -0500 User-Agent: KMail/1.9.1 References: <200611021745.kA2HjSZC018731@repoman.freebsd.org> <200701121206.47308.jhb@freebsd.org> <45B4D1AF.9070101@freebsd.org> In-Reply-To: <45B4D1AF.9070101@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701221054.33982.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 22 Jan 2007 10:54:51 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2477/Mon Jan 22 10:10:05 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00, UPPERCASE_25_50 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern uipc_socket.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jan 2007 15:54:59 -0000 On Monday 22 January 2007 10:01, Andre Oppermann wrote: > John Baldwin wrote: > > Also, you've introduced another regression in that if the m_get2m() fails it > > should be returning ENOBUFS and not EFAULT to userland. The comments in > > sosend_*() about 'EFAULT being the only possible error' are obviously > > wrong. :) > > We're always calling with M_WAITOK because we're coming from userland and > may sleep forever. Bah, ok. I was confused because I guess TRYWAIT can't return NULL anymore, but sosend_copyin() still has: MGETHDR(m, M_TRYWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; goto out; } although it would seem that the ZERO_COPY_SOCKETS code just needs to be updated. Maybe like so: Index: uipc_socket.c =================================================================== RCS file: /usr/cvs/src/sys/kern/uipc_socket.c,v retrieving revision 1.288 diff -u -r1.288 uipc_socket.c --- uipc_socket.c 8 Jan 2007 17:49:59 -0000 1.288 +++ uipc_socket.c 22 Jan 2007 15:52:06 -0000 @@ -857,20 +857,11 @@ if (resid >= MINCLSIZE) { #ifdef ZERO_COPY_SOCKETS if (top == NULL) { - MGETHDR(m, M_TRYWAIT, MT_DATA); - if (m == NULL) { - error = ENOBUFS; - goto out; - } + m = m_gethdr(M_TRYWAIT, MT_DATA); m->m_pkthdr.len = 0; m->m_pkthdr.rcvif = NULL; - } else { - MGET(m, M_TRYWAIT, MT_DATA); - if (m == NULL) { - error = ENOBUFS; - goto out; - } - } + } else + m = m_get(M_TRYWAIT, MT_DATA); if (so_zero_copy_send && resid>=PAGE_SIZE && *space>=PAGE_SIZE && @@ -881,14 +872,8 @@ len = cow_send; } if (!cow_send) { - MCLGET(m, M_TRYWAIT); - if ((m->m_flags & M_EXT) == 0) { - m_free(m); - m = NULL; - } else { - len = min(min(MCLBYTES, resid), - *space); - } + m_clget(m, M_TRYWAIT); + len = min(min(MCLBYTES, resid), *space); } #else /* ZERO_COPY_SOCKETS */ if (top == NULL) { -- John Baldwin