Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Dec 2013 12:57:04 -0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        Jack F Vogel <jfv@freebsd.org>, Michael Tuexen <Michael.Tuexen@lurchi.franken.de>, freebsd-net <freebsd-net@freebsd.org>
Subject:   Re: buf_ring in HEAD is racy
Message-ID:  <CAJ-Vmomuex9TJwxctjsn2DUrDE6wpUr4%2B9iPVr1-5tyhEFPFEA@mail.gmail.com>
In-Reply-To: <CAFMmRNysDGD-pjcNw6L3%2BA%2BBTprZMZ==MxKJonpNz574D-UNFQ@mail.gmail.com>
References:  <CAFMmRNyJpvZ0AewWr62w16=qKer%2BFNXUJJy0Qc=EBqMnUV3OyQ@mail.gmail.com> <CAJ-VmonJG-M_f_m36f-z3ArumBKNdt5%2B6muwFJzWABRxRQWJaw@mail.gmail.com> <CAJ-Vmo=OpWZ_OphA=%2BXbmgHw%2BFwuCMwngHq9_2WOnNHMa_RA9A@mail.gmail.com> <CAJ-Vmo=iayVJiMNihmPf_Dd18uEZ5W-j9E3g4SeaRhfFJQj4Ow@mail.gmail.com> <E5612C2C-C9B9-45D8-A794-9993FE39D9E6@lurchi.franken.de> <CAJ-Vmomw8qF4f=ZVA0ELHOXtcD-4OQosBU3gqeM5p-zKbPbcdg@mail.gmail.com> <CAJ-Vmo=%2BxqBc1S5ENNq5Fdh26gxKhiMTq3w9Uqk7zPrBTMizzQ@mail.gmail.com> <CAFMmRNysDGD-pjcNw6L3%2BA%2BBTprZMZ==MxKJonpNz574D-UNFQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 17 December 2013 19:37, Ryan Stone <rysto32@gmail.com> wrote:

> The trick with this is that if ALTQ is enabled then we will use if_snd
> queue instead of the buf ring, and if that queue drops then ifq_drops
> will be incremented.  With this patch if ALTQ is in use then we will
> not count any drops (as you will be overwriting the drop count from
> the queue).

Right. Well, that means it's a problem for at least the chelsio driver as well.

Hm, guess we could save the previous value of the sampled drops
counters and add the delta to the send queue?

Oh it gets more interesting - ip_output() also increments it if the
queue structure itself can't hold it. It doesn't even hold any locks
when it does that check so it's racy anyway. Aieee...

Let me think about it a bit more.

Thanks,



-adrian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmomuex9TJwxctjsn2DUrDE6wpUr4%2B9iPVr1-5tyhEFPFEA>