From owner-svn-src-all@freebsd.org Sat Aug 20 10:08:12 2016 Return-Path: Delivered-To: svn-src-all@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 32B90BBE71B; Sat, 20 Aug 2016 10:08:12 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00B931D64; Sat, 20 Aug 2016 10:08:12 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id y134so17039971pfg.0; Sat, 20 Aug 2016 03:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RTBoPYKDXjEhQMmHNzONhCLcBtzhsYUbtTJHWPKHfMc=; b=fUN3rASsbJpJwhe4dx0DyB7acKukOq2SXzSNWOjSNVOUBAFdFk/7HofwZR37Yhx3/x hKm7buu9Vpc31i3VjB1v8Q5Bc9oQI4EZihJhPCQB7krbKSaMee/CObbGIlN9HDkEh+Ec Q+LVpp6kaCgjSa55kXwg4AoWu8bUOS0qSajwFzy+Jlwcv6oXRys1WP//LAguc9A5oEOc kEaqDCu8d8TLMhKi7M1uTZ587ohTfowUVwZlJ2zF/EAL4yXolMjokMisiwHX4kmpxunh zimXGvpXEPNDTOCEWVJTMUhaayYKus15424kn6v86wqEdakAbYTwHkzZxNWX93lEfSGo KArg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=RTBoPYKDXjEhQMmHNzONhCLcBtzhsYUbtTJHWPKHfMc=; b=XJcWa66vmQ64uG06Oe1KqZAWuGEdnFBuVPdyjHLv/6VG/hdbrbL7LNZ9ifrCAQb/Yd NgPkaIlNvY7CnAGfxKdpsj9e1Q4immcEsahwSmT/SfGsq7DjyuLlEbJe6HceFlr88T0H w3n6mcUfvwG6xdeXtZ7v9Mix/7Xl5g5YTEj4oPtSlI8wn75nvjSCi7McIvn2NuQvn0iV fJy9yoboxS3ATULVMOviEJ8WUaQaKvOL1/jP71GbspZEz/uiV6jcs/g5BHgSnOiQTYvs 5veZJgjPe69TcHQGiJ0i2C7+nIRCsN1ZOD7xSEiGQWdbXREFAEisylIsUNZajLKT3BjH jawg== X-Gm-Message-State: AEkoouvPH5ZsF0SLh8RvEw3UF0tBOH4fnjsUYOK+Xq6LYjn5FvO0J9kTt47uF+RyMqG65Q== X-Received: by 10.98.80.220 with SMTP id g89mr22649121pfj.12.1471687691487; Sat, 20 Aug 2016 03:08:11 -0700 (PDT) Received: from ?IPv6:2001:44b8:31ae:7b01:f985:3c4b:2a0c:8bea? (2001-44b8-31ae-7b01-f985-3c4b-2a0c-8bea.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:f985:3c4b:2a0c:8bea]) by smtp.gmail.com with ESMTPSA id w76sm12698589pfd.69.2016.08.20.03.08.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Aug 2016 03:08:10 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r304435 - head/sys/netinet References: <201608182259.u7IMx0bx001967@repo.freebsd.org> To: Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <96b7428a-0a57-6d6d-4b2e-24010596ceaf@FreeBSD.org> Date: Sat, 20 Aug 2016 20:08:01 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Thunderbird/50.0a2 MIME-Version: 1.0 In-Reply-To: <201608182259.u7IMx0bx001967@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2016 10:08:12 -0000 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