Date: Sat, 20 Aug 2016 20:08:01 +1000 From: Kubilay Kocak <koobs@FreeBSD.org> To: Ryan Stone <rstone@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304435 - head/sys/netinet Message-ID: <96b7428a-0a57-6d6d-4b2e-24010596ceaf@FreeBSD.org> In-Reply-To: <201608182259.u7IMx0bx001967@repo.freebsd.org> References: <201608182259.u7IMx0bx001967@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 19/08/2016 8:59 AM, Ryan Stone wrote: > Author: rstone > Date: Thu Aug 18 22:59:00 2016 > New Revision: 304435 > URL: https://svnweb.freebsd.org/changeset/base/304435 > > Log: > Don't iterate over the ifnet addr list in ip_output() > > For almost every packet that is transmitted through ip_output(), > a call to in_broadcast() was made to decide if the destination > IP was a broadcast address. in_broadcast() iterates over the > ifnet's address to find a source IP matching the subnet of the > destination IP, and then checks if the IP is a broadcast in that > subnet. > > This is completely redundant as we have already performed the > route lookup, so the source IP is already known. Just use that > address to directly check whether the destination IP is a > broadcast address or not. Hi Ryan, Could you elaborate on any of the potential performance implications of this? > MFC after: 2 months > Sponsored By: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D7266 > > Modified: > head/sys/netinet/in.c > head/sys/netinet/in.h > head/sys/netinet/ip_output.c > > Modified: head/sys/netinet/in.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?96b7428a-0a57-6d6d-4b2e-24010596ceaf>