Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Sep 2009 11:10:40 -0700
From:      Jack Vogel <jfvogel@gmail.com>
To:        Dmitrij Tejblum <tejblum@yandex-team.ru>
Cc:        Barney Cordoba <barney_cordoba@yahoo.com>, Manish Vachharajani <manishv@lineratesystems.com>, freebsd-net@freebsd.org
Subject:   Re: Dropped vs. missed packets in the ixgbe driver
Message-ID:  <2a41acea0909051110v755f66cbkfc4d2f84b3d8a353@mail.gmail.com>
In-Reply-To: <4AA2A3B5.3000108@yandex-team.ru>
References:  <5bc218350908191146j2a22f8dcrdecb0b67eedce5c2@mail.gmail.com> <5bc218350908200953p630d99c6u1538999b308c55f9@mail.gmail.com> <2a41acea0908201008y6e8f160dx27b406db7d3081b7@mail.gmail.com> <5bc218350908201023q14c51cer6effadd49cc4c604@mail.gmail.com> <5bc218350908201032l44859117obc3203ad91fc5706@mail.gmail.com> <5bc218350908201034u553df7feiaead037432279360@mail.gmail.com> <2a41acea0908201037n10505b04le924f29efd5398a7@mail.gmail.com> <5bc218350908201039q574f92e3mabe73d01c35f662c@mail.gmail.com> <2a41acea0908201721o33372c89q25e33b8cde8edf06@mail.gmail.com> <4AA2A3B5.3000108@yandex-team.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Sigh, yes, you're right, I will get this corrected after the holiday
weekend.

Thanks,

Jack

On Sat, Sep 5, 2009 at 10:45 AM, Dmitrij Tejblum <tejblum@yandex-team.ru>wrote:

> Jack,
>
> The code you committed does not look right with respect to missed packets
> counting:
>
>
>        for (int i = 0; i < 8; i++) {
>                /* missed_rx tallies misses for the gprc workaround */
>                missed_rx += IXGBE_READ_REG(hw, IXGBE_MPC(i));
>                adapter->stats.mpc[i] += missed_rx;
>                /* Running comprehensive total for stats display */
>                total_missed_rx += adapter->stats.mpc[i];
>                if (hw->mac.type == ixgbe_mac_82598EB)
>                        adapter->stats.rnbc[i] +=
>                            IXGBE_READ_REG(hw, IXGBE_RNBC(i));
>        }
>
> You see, the value of the MPC(0) register also added to mpc[1], mpc[2], ...
> mpc[7], and thus gets added to total_missed_rx 8 times. The MPC(1) register
> gets added to total_missed_rx 7 times, and so on.
>
>
> I would suggest something like this:
>
>        for (int i = 0; i < 8; i++) {
>                u32 mp;
>                mp = IXGBE_READ_REG(hw, IXGBE_MPC(i));
>                /* missed_rx tallies misses for the gprc workaround */
>                missed_rx += mp;
>                adapter->stats.mpc[i] += mp;
>                /* Running comprehensive total for stats display */
>                total_missed_rx += adapter->stats.mpc[i];
>                if (hw->mac.type == ixgbe_mac_82598EB)
>                        adapter->stats.rnbc[i] +=
>                            IXGBE_READ_REG(hw, IXGBE_RNBC(i));
>        }
>
> Also, there was PR kern/127834 on this issue, that should be closed as the
> issue fixed.
>
>
>
>
> --
> Dima
>



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