From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [patch] Performance enhancement patches for SB1250 MAC Date: Tue, 21 Nov 2006 11:12:50 -0800 Message-ID: <20061121111250.093c423c@freekitty> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "Martin Michlmayr" , Return-path: Received: from smtp.osdl.org ([65.172.181.25]:26263 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1031327AbWKUTMz (ORCPT ); Tue, 21 Nov 2006 14:12:55 -0500 To: "Yang, Steve" In-Reply-To: Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Tue, 21 Nov 2006 08:45:58 -0800 "Yang, Steve" wrote: > Martin, > > I've attached the two patches with this email. > > Original submission email text: > > "The attached are two network performance enhancement patches for SB1250 > MAC. The NAPI patch applies first. Followed by the "skb cache" patch. > They applied and builds cleanly on 2.6.18 kernel for the following > kernel option combinations: > > SBMAC_NAPI no yes yes > SKB_CACHE no no yes" > > Regards, > Steve Yang > > -----Original Message----- > From: Martin Michlmayr [mailto:tbm@cyrius.com] > Sent: Tuesday, November 21, 2006 6:27 AM > To: Stephen Hemminger > Cc: Yang, Steve; netdev@vger.kernel.org > Subject: Re: [patch] Performance enhancement patches for SB1250 MAC > > * Stephen Hemminger [2006-11-20 15:35]: > > > 1. I've submitted two patches, one for NAPI and the other for > SKB_Cache. > > > They can go in individually. You've expressed objections to > SKB_Cache. > > > What about the one for NAPI? > > Yes, the NAPI one is great. > > Should Steve resend the patch so it can be added or is it queued up > already? It would be nice to have this in 2.6.20. > -- > Martin Michlmayr > tbm@cyrius.com One comment about the driver in general (not NAPI related), is that almost all uses of "volatile" in a driver are incorrect. Especially these because the device memory (__iomem) should already be mapped non-cached. Volatile protects against compiler issues, not device consistency. @@ -197,13 +206,16 @@ volatile void __iomem *sbdma_config0; /* DMA config register 0 */ volatile void __iomem *sbdma_config1; /* DMA config register 1 */ volatile void __iomem *sbdma_dscrbase; /* Descriptor base address */ - volatile void __iomem *sbdma_dscrcnt; /* Descriptor count register */ + volatile void __iomem *sbdma_dscrcnt; /* Descriptor count register */ volatile void __iomem *sbdma_curdscr; /* current descriptor address */ + volatile void __iomem *sbdma_oodpktlost;/* pkt drop (rx only) */ + Also, how is this NAPI related (probably should be a different patch. But I no nothing about MIPS SMP. Index: linux-2.6.14-cgl/arch/mips/sibyte/bcm1480/irq.c =================================================================== --- linux-2.6.14-cgl.orig/arch/mips/sibyte/bcm1480/irq.c 2006-09-20 14:58:41.000000000 -0700 +++ linux-2.6.14-cgl/arch/mips/sibyte/bcm1480/irq.c 2006-09-20 15:58:33.000000000 -0700 @@ -144,11 +144,11 @@ unsigned long flags; unsigned int irq_dirty; - i = first_cpu(mask); - if (next_cpu(i, mask) <= NR_CPUS) { + if (cpus_weight(mask) != 1) { printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq); return; } + i = first_cpu(mask); /* Convert logical CPU to physical CPU */ cpu = cpu_logical_map(i); -- Stephen Hemminger