Date: Sat, 05 Sep 2009 21:45:25 +0400 From: Dmitrij Tejblum <tejblum@yandex-team.ru> To: Jack Vogel <jfvogel@gmail.com> 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: <4AA2A3B5.3000108@yandex-team.ru> In-Reply-To: <2a41acea0908201721o33372c89q25e33b8cde8edf06@mail.gmail.com> References: <5bc218350908191146j2a22f8dcrdecb0b67eedce5c2@mail.gmail.com> <435336.24858.qm@web63908.mail.re1.yahoo.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>
next in thread | previous in thread | raw e-mail | index | archive | help
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?4AA2A3B5.3000108>