Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jul 2016 13:41:18 -0700
From:      Adrian Chadd <adrian.chadd@gmail.com>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        Andrew Gallatin <gallatin@netflix.com>,  "<freebsd-transport@freebsd.org>" <freebsd-transport@freebsd.org>
Subject:   Re: in_broadcast() called for almost every packet in ip_output()
Message-ID:  <CAJ-Vmo=xU9dmsf0=Sx5wWTqmgpx_eLiSG-_aj=VAdEdW-VOV%2BA@mail.gmail.com>
In-Reply-To: <CAFMmRNyeUiru=t3i5ymhQiCnNivV9-=PYK6F0ak0swZo2M969A@mail.gmail.com>
References:  <CAFMmRNx%2Bx9GNDgDHO5oyoj-S%2BCK9bRvJhpNNFf3%2BPk0p2SQeSQ@mail.gmail.com> <CADLQ3sLyytm0HMsSChhWD108t6iPpquXH2E2R7Wc42FpaAP1Rw@mail.gmail.com> <CAFMmRNyi1-K%2BKX6bY2bx7_hiq2PDPJa-QJatBf0QdtriGnJ5fw@mail.gmail.com> <559f1d0e-9d35-f458-bff5-b69a03297cf0@netflix.com> <CAFMmRNxjpZMVbRLv-xqYNTXjCUh6=oDPfqK_cM47i64bRs51eA@mail.gmail.com> <CAFMmRNyeUiru=t3i5ymhQiCnNivV9-=PYK6F0ak0swZo2M969A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

I care about the performance of unconnected UDP; it's how a lot of UDP
network services work to arbitrary clients. It works fine and
parallelises fine in the RSS case (as in, linear scaling to
num-queues; so I've done millions of pps through that path.)

The in_broadcast() overhead sucked; I found that out when using IP
aliases on an interface and discovered the in_broadcast() check sucked
time if you didn't bind the local address (forcing it to an address
lookup/determination each time, for reasons I forgot.)

So, ideally we'd just do some two-stage caching mechanism using
atomics, rcu, generation count, etc where we'd do a cheap hash lookup
to see if we have to do the slow broadcast check, and then the
broadcast check itself would be a hash rather than a linear O(n) list
walk.



-adrian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=xU9dmsf0=Sx5wWTqmgpx_eLiSG-_aj=VAdEdW-VOV%2BA>