From owner-freebsd-net@FreeBSD.ORG Sat Sep 5 18:10:42 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 DF68A1065676 for ; Sat, 5 Sep 2009 18:10:41 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.210.172]) by mx1.freebsd.org (Postfix) with ESMTP id 927F88FC1A for ; Sat, 5 Sep 2009 18:10:41 +0000 (UTC) Received: by yxe2 with SMTP id 2so3870338yxe.3 for ; Sat, 05 Sep 2009 11:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=zwYC2Ve95+9xHfgwt4evgm5EBBPGaHWO3JOy6Ag5564=; b=H0rAwJGzVq7gBIYETatmFMp5xGfBeJ6A2GAxVYprwK8K/BHScsknx+BarUm5imsvif fWxP4iWDXApwcpBfdkXiJ04bwMZn8r2JTked3zVvxH0UHI6CLJEhGznIyCVJT0IZft/9 g8RwqE2DhYKrX5RAiIV0Qncm+sAgbPVQN7nQw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=iTXWDTmtPMv+qtBSAGJllHJ2DWRpHT0p8MrW2tJIMmkAtrmge7Uj/gxKF9BP5mX0wn nY3LK2diXcF3pPP1562MKkNiwC+j+VazQRo8eDEwSAXjmEbmURk3xAgyh0LStp4NiVoq 6cn4hfuexB6rxHY63gLpMa/fLxOgEHq8j7JAY= MIME-Version: 1.0 Received: by 10.101.56.13 with SMTP id i13mr1539318ank.194.1252174240779; Sat, 05 Sep 2009 11:10:40 -0700 (PDT) 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> Date: Sat, 5 Sep 2009 11:10:40 -0700 Message-ID: <2a41acea0909051110v755f66cbkfc4d2f84b3d8a353@mail.gmail.com> From: Jack Vogel To: Dmitrij Tejblum Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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:10:42 -0000 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 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 >