Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Nov 2017 11:28:12 -0800
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        =?utf-8?Q?Micha=C5=82?= Krawczyk <mk@semihalf.com>
Cc:        Marcin Wojtas <mw@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r325239 - head/sys/dev/ena
Message-ID:  <20171122192812.GI1063@FreeBSD.org>
In-Reply-To: <CAJMMOfP6tpAKv2EBNiSkwNNKCPNr2s19Ek8QkVZsANYBQiTfCg@mail.gmail.com>
References:  <201710311631.v9VGVNOs058255@repo.freebsd.org> <20171122000816.GH1063@FreeBSD.org> <CAJMMOfP6tpAKv2EBNiSkwNNKCPNr2s19Ek8QkVZsANYBQiTfCg@mail.gmail.com>

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

  thanks for explanation. Looks like in this case software counters
are indeed superior to hardware ones.

On Wed, Nov 22, 2017 at 05:19:54PM +0100, Michał Krawczyk wrote:
M> Hi Gleb,
M> We are counting the statistics in the software because of the alignment
M> with the newest ena-com API (HAL) which is delivered to us from NIC's
M> vendor.
M> 
M> Regarding fetching them periodically - there are 2 issues with that. First
M> of all, there may be problem with the counter overflow. Secondly, reading
M> statistics on demand requires sending admin message to the NIC and then the
M> cv_timedwait function is called to wait for the response. However there are
M> a lot of witness warnings when the cv_timedwait is called from the
M> if_get_counter() context, because of the non sleepable lock which is hold
M> there (I don't remember exactly which lock was causing this issue).
M> 
M> Best regards,
M> Michal
M> 
M> 2017-11-22 1:08 GMT+01:00 Gleb Smirnoff <glebius@freebsd.org>:
M> 
M> >   Hi Martin and Michal,
M> >
M> > On Tue, Oct 31, 2017 at 04:31:23PM +0000, Marcin Wojtas wrote:
M> > M> Author: mw
M> > M> Date: Tue Oct 31 16:31:23 2017
M> > M> New Revision: 325239
M> > M> URL: https://svnweb.freebsd.org/changeset/base/325239
M> > M>
M> > M> Log:
M> > M>   Rework counting of hardware statistics in ENA driver
M> > M>
M> > M>   Do not read all statistics from the device, instead count them in the
M> > M>   driver except from RX drops - they are received directly from the NIC
M> > M>   in the AENQ descriptor.
M> > M>
M> > M>   Submitted by: Michal Krawczyk <mk@semihalf.com>
M> > M>   Reviewed by: imp
M> > M>   Obtained from: Semihalf
M> > M>   Sponsored by: Amazon.com, Inc.
M> > M>   Differential Revision: https://reviews.freebsd.org/D12852
M> >
M> > Is it possible not to count them in software, as well as not fetch
M> > them from hardware periodically, but instead just fetch them on
M> > demand, when either if_get_counter() or a sysctl is called?
M> >
M> > That would be more efficient.
M> >
M> > --
M> > Gleb Smirnoff
M> >

-- 
Gleb Smirnoff



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