Subject: Re: [patch] Performance enhancement patches for SB1250 MAC

From: Stephen Hemminger <[email-masked]>
Date: Tue, 21 Nov 2006 11:12:50 -0800

On Tue, 21 Nov 2006 08:45:58 -0800
"Yang, Steve" <[email-masked]> 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:[email-masked]] 
> Sent: Tuesday, November 21, 2006 6:27 AM
> To: Stephen Hemminger
> Cc: Yang, Steve; [email-masked]
> Subject: Re: [patch] Performance enhancement patches for SB1250 MAC
> 
> * Stephen Hemminger <[email-masked]> [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
> [email-masked]

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 <[email-masked]>