Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jul 2016 15:00:51 -0400
From:      Drew Gallatin <gallatin@netflix.com>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        freebsd-transport@freebsd.org
Subject:   Re: in_broadcast() called for almost every packet in ip_output()
Message-ID:  <CADLQ3sLyytm0HMsSChhWD108t6iPpquXH2E2R7Wc42FpaAP1Rw@mail.gmail.com>
In-Reply-To: <CAFMmRNx%2Bx9GNDgDHO5oyoj-S%2BCK9bRvJhpNNFf3%2BPk0p2SQeSQ@mail.gmail.com>
References:  <CAFMmRNx%2Bx9GNDgDHO5oyoj-S%2BCK9bRvJhpNNFf3%2BPk0p2SQeSQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I'd certainly prefer not to add any overhead.  Properly managing this (and
other similar) lists is a job for some lightweight lifecycle based
mechanism like concurrency kit or rcu.

Unless you have a solid  reason to fix it, I'd suggest just adding the
locking commented out (the way rwatson did with IN_IFADDR_RLOCK in
ip_input(), so that the next person to trip over it will know what's going
on.

Drew

On Wed, Jul 20, 2016 at 1:29 PM, Ryan Stone <rysto32@gmail.com> wrote:

> I've hit a dilemma in a fix I have in review[1].  Currently, in_broadcast()
> iterates over the ifnet address list without holding any locks.  I can
> pretty easily panic the kernel by constantly adding and removing addresses
> while passing traffic over the interface.  The fix is to acquire the
> appropriate rlock, but the catch is that according to dtrace,
> in_broadcast() is called on almost every packet that passes through
> ip_output().  I'm concerned about adding additional locking operations to
> the transmit path.
>
> Do we actually need to call in_broadcast() so often?  It seems silly to
> check whether we are sending to a broadcast address on a per-packet basis.
>
>
> [1] https://reviews.freebsd.org/D7227
> _______________________________________________
> freebsd-transport@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-transport
> To unsubscribe, send any mail to "
> freebsd-transport-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLQ3sLyytm0HMsSChhWD108t6iPpquXH2E2R7Wc42FpaAP1Rw>