From owner-freebsd-net@FreeBSD.ORG Sat Sep 5 18:00:37 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E283106566C for ; Sat, 5 Sep 2009 18:00:37 +0000 (UTC) (envelope-from tejblum@yandex-team.ru) Received: from mammoth.yandex.ru (mammoth.yandex.ru [93.158.136.51]) by mx1.freebsd.org (Postfix) with ESMTP id D4A828FC13 for ; Sat, 5 Sep 2009 18:00:36 +0000 (UTC) Received: from tejblum.pp.ru (dhcp250-245.yandex.ru [87.250.250.245]) by mammoth.yandex.ru (Postfix) with ESMTPS id E951C4F6EC9; Sat, 5 Sep 2009 21:45:26 +0400 (MSD) Message-ID: <4AA2A3B5.3000108@yandex-team.ru> Date: Sat, 05 Sep 2009 21:45:25 +0400 From: Dmitrij Tejblum User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.17) Gecko/20081109 SeaMonkey/1.1.12 MIME-Version: 1.0 To: Jack Vogel 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> In-Reply-To: <2a41acea0908201721o33372c89q25e33b8cde8edf06@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Barney Cordoba , Manish Vachharajani , freebsd-net@freebsd.org Subject: Re: Dropped vs. missed packets in the ixgbe driver X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Sep 2009 18:00:37 -0000 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