From owner-freebsd-net@FreeBSD.ORG Sat Aug 30 09:59:31 2008 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37B051065671; Sat, 30 Aug 2008 09:59:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 01C218FC12; Sat, 30 Aug 2008 09:59:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id A110146B92; Sat, 30 Aug 2008 05:59:30 -0400 (EDT) Date: Sat, 30 Aug 2008 10:59:30 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Sam Leffler In-Reply-To: <48B8CE01.6010604@freebsd.org> Message-ID: References: <20080825190207.GA73478@zibbi.meraka.csir.co.za> <20080825194038.GA75840@zibbi.meraka.csir.co.za> <20080826144130.S66593@maildrop.int.zabbadoz.net> <48B4A62D.3080300@freebsd.org> <20080829162853.GB46693@onelab2.iet.unipi.it> <48B8248A.3060103@freebsd.org> <20080829164145.GA47030@onelab2.iet.unipi.it> <20080829223546.GG98483@citylink.fud.org.nz> <48B8CE01.6010604@freebsd.org> User-Agent: Alpine 1.10 (BSF 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: "Bjoern A. Zeeb" , gnn@freebsd.org, Luigi Rizzo , Andrew Thompson , net@freebsd.org Subject: Re: Small patch to multicast code... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Aug 2008 09:59:31 -0000 On Fri, 29 Aug 2008, Sam Leffler wrote: >> The bridge code does a deep copy of the packet for each interface it >> broadcasts on due the firewall code modifying the headers. It sounds like >> this should just be a copy+pullup instead. > > I'd not do that. I think there are paths that assume the deep copy. Right > now the network code is very poor honoring read-only-ness of mbuf chains. > To get this right we need to do a good audit. I know I hit issues when > doing some tricks w/ marking rx buffers read-only to avoid cache flushes. > netbsd trys to be more pedantic but still has problems too. This strikes me as an extremely tricky thing to get right as bugs manifest in very subtle ways. The IP output path makes lots of assumptions about being able to continue to write to outgoing headers for the purposes of deferred checksum calculation, NAT, IPSEC, fragmentation, encapsulation, etc. IP multicast loopback is just one of the rare edge cases where, if exercised, we currently deterministically discover this, but presumably there's more to come as parallelism continues to increase. Robert N M Watson Computer Laboratory University of Cambridge