From patchwork Wed Feb 3 18:31:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 44400 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id F0777B7EA5 for ; Thu, 4 Feb 2010 05:31:49 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756319Ab0BCSbn (ORCPT ); Wed, 3 Feb 2010 13:31:43 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:38196 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752736Ab0BCSbm (ORCPT ); Wed, 3 Feb 2010 13:31:42 -0500 Received: from nehalam (pool-74-107-135-205.ptldor.fios.verizon.net [74.107.135.205]) (authenticated bits=0) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id o13IVHjU005873 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 3 Feb 2010 10:31:19 -0800 Date: Wed, 3 Feb 2010 10:31:12 -0800 From: Stephen Hemminger To: Michael Breuer Cc: netdev@vger.kernel.org Subject: Re: [PATCH] sky2: Flow control frames recorded as dropped packets Message-ID: <20100203103112.091b1b14@nehalam> In-Reply-To: <4B69AAA9.20505@majjas.com> References: <4B69AAA9.20505@majjas.com> Organization: Linux Foundation X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Spam-Status: No, hits=-6.077 required=5 tests=AWL, BAYES_00, FH_HOST_EQ_VERIZON_P, OSDL_HEADER_SUBJECT_BRACKETED, PATCH_SUBJECT_OSDL, RDNS_DYNAMIC X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Thanks for your patch. A more general solution would be to move the rx_dropped up into sky2_receive. Signed-off-by: Stephen Hemminger --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/net/sky2.c 2010-02-03 09:10:27.863367226 -0800 +++ b/drivers/net/sky2.c 2010-02-03 09:17:01.602741445 -0800 @@ -2404,6 +2404,9 @@ okay: skb = receive_copy(sky2, re, length); else skb = receive_new(sky2, re, length); + + dev->stats.rx_dropped += (skb == NULL); + resubmit: sky2_rx_submit(sky2, re); @@ -2515,11 +2518,10 @@ static int sky2_status_intr(struct sky2_ case OP_RXSTAT: total_packets[port]++; total_bytes[port] += length; + skb = sky2_receive(dev, length, status); - if (unlikely(!skb)) { - dev->stats.rx_dropped++; + if (!skb) break; - } /* This chip reports checksum status differently */ if (hw->flags & SKY2_HW_NEW_LE) {