Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932436Ab0HaPNL (ORCPT ); Tue, 31 Aug 2010 11:13:11 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:56607 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932421Ab0HaPNH (ORCPT ); Tue, 31 Aug 2010 11:13:07 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=kbX1Stj94CpO/qanzD0Va1SR/chkg49E/5dLylqqczVT+tVpehJ9c/F1k2MC39gzmV FRoPpC64lIsDvACfbgbSDx6S5KwOHGPYedBY7vGZJwKPHmNVQGs5/2AcUVRIRQfFq9nm Bv2AgZIy/k0tl1s8NEy2FzkT7ez0N4DMUrz+0= Subject: Re: [PATCH] Gigabit Ethernet driver of Topcliff PCH From: Eric Dumazet To: Masayuki Ohtake Cc: Stephen Hemminger , Sam Ravnborg , Joe Perches , LKML , ML netdev , Greg Rose , Maxime Bizon , Kristoffer Glembo , Ralf Baechle , John Linn , Randy Dunlap , "David S. Miller" , MeeGo , "Wang, Qi" , "Wang, Yong Y" , Andrew , Intel OTC , "Foster, Margie" , Toshiharu Okada , Tomoya Morinaga , Takahiro Shimizu In-Reply-To: <4C7D0E7A.5060309@dsn.okisemi.com> References: <4C763A67.5040107@dsn.okisemi.com> <4C7D0E7A.5060309@dsn.okisemi.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 31 Aug 2010 16:51:03 +0200 Message-ID: <1283266263.2550.106.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2154 Lines: 73 Le mardi 31 août 2010 à 23:15 +0900, Masayuki Ohtake a écrit : > Hi Sam, Joe and Stephen > > Thank you for your comments. > We have modified this driver for your comment. > > --- > Gigabit Ethernet driver of Topcliff PCH > + skb->protocol = eth_type_trans(skb, netdev); > + if ((tcp_ip_status & PCH_GBE_RXD_ACC_STAT_TCPIPOK) == > + PCH_GBE_RXD_ACC_STAT_TCPIPOK) { > + skb->ip_summed = CHECKSUM_UNNECESSARY; > + } else { > + skb->ip_summed = CHECKSUM_NONE; > + } > + > + if (netif_receive_skb(skb) == NET_RX_DROP) { > + adapter->stats.rx_dropped++; dont use pr_err() here, dropping a frame is a normal condition. > + pr_err("Receive Netif Receive Dropped Error\n"); > + } > + (*work_done)++; > + netdev->last_rx = jiffies; really ? last_rx is a thing of the past. > + pr_debug > + ("Receive skb->ip_summed: %d length: %d\n", > + skb->ip_summed, length); > + } > +dorrop: > + /* return some buffers to hardware, one at a time is too slow */ > + if (unlikely(cleaned_count >= PCH_GBE_RX_BUFFER_WRITE)) { > + pch_gbe_alloc_rx_buffers(adapter, rx_ring, > + cleaned_count); > + cleaned_count = 0; > + } > + if (++i == rx_ring->count) > + i = 0; > + } > + rx_ring->next_to_clean = i; > + if (cleaned_count) > + pch_gbe_alloc_rx_buffers(adapter, rx_ring, cleaned_count); > + return cleaned; > +} > + I find hard to believe this driver needs to copy all outgoing frames on pre-allocated skbs. + /* [Header:14][payload] ---> [Header:14][paddong:2][payload] */ + memcpy(tmp_skb->data, skb->data, ETH_HLEN); + tmp_skb->data[ETH_HLEN] = 0x00; + tmp_skb->data[ETH_HLEN + 1] = 0x00; + tmp_skb->len = skb->len; + memcpy(&tmp_skb->data[ETH_HLEN + 2], &skb->data[ETH_HLEN], + (skb->len - ETH_HLEN)); + buffer_info->kernel_skb = skb; + skb = tmp_skb; Whats the deal here please ? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/