From owner-freebsd-net@FreeBSD.ORG Thu Feb 20 17:30:01 2014 Return-Path: Delivered-To: freebsd-net@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65B3C624 for ; Thu, 20 Feb 2014 17:30:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4EF761996 for ; Thu, 20 Feb 2014 17:30:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s1KHU10m018920 for ; Thu, 20 Feb 2014 17:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s1KHU11L018919; Thu, 20 Feb 2014 17:30:01 GMT (envelope-from gnats) Date: Thu, 20 Feb 2014 17:30:01 GMT Message-Id: <201402201730.s1KHU11L018919@freefall.freebsd.org> To: freebsd-net@FreeBSD.org Cc: From: Alan Somers Subject: Re: kern/181741: [kernel] [patch] Packet loss when ' control' messages are present with large data (sendmsg(2)) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Alan Somers List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 17:30:01 -0000 The following reply was made to PR kern/181741; it has been noted by GNATS. From: Alan Somers To: bug-followup@FreeBSD.org, yuri@rawbw.com Cc: Subject: Re: kern/181741: [kernel] [patch] Packet loss when 'control' messages are present with large data (sendmsg(2)) Date: Thu, 20 Feb 2014 10:29:27 -0700 I've been working on kern/185813, which is closely related. My comments on your patch: 1) In uipc_socket.c, you twice do "if (clen > space) error = EMSGSIZE". Should the comparison be with sp->so_snd->sb_hiwat instead of space? Space shrinks when the sockbuf is partially full, but sb_hiwat is constant. (Actually, sb_hiwat also shrinks for Unix domain sockets, but I am going to fix that as part of kern/185812). 2) In uipc_finalizecontrol(), I think that you need to grab UNP_LINK_RLOCK to protect the linkage between unp and unp2. 3) It would be fantastic if you could convert the testcase to ATF format. ATF is the new format that all testcases should use going forward. It's easily automatable, unlike the stuff in tools/regression, and it's very flexible too. https://wiki.freebsd.org/TestingFreeBSD 4) I think there are some tab/space issues with the patch, but I'm not positive because I'm reading it in Firefox. -Alan