netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Naming interrupt vectors/niu
@ 2008-11-25 15:45 Robert Olsson
  2008-11-25 15:58 ` Jesper Dangaard Brouer
  2008-11-26  0:42 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Robert Olsson @ 2008-11-25 15:45 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Robert.Olsson



 Hi,

 A patch to put names on the niu interrupt vectors according the syntax below. 
 This is needed to assign correct affinity.

 > So on a multiqueue card with 2 RX queues and 2 TX queues we'd
 > have names like:
 > 
 > 	eth0-rx-0
 > 	eth0-rx-1
 > 	eth0-tx-0
 > 	eth0-tx-1


Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>


diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 1b6f548..9798312 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -5849,17 +5849,43 @@ static void niu_stop_hw(struct niu *np)
 	niu_reset_rx_channels(np);
 }
 
+static void niu_set_irq_name(struct niu *np)
+{
+	int i, j = 1;
+	int port = np->port;
+	
+	sprintf(np->irq_name[0], "%s:MAC", np->dev->name); 
+	 
+	if(port == 0) {
+		sprintf(np->irq_name[1], "%s:MIF", np->dev->name); 
+		sprintf(np->irq_name[2], "%s:SYSERR", np->dev->name); 
+		j = 3;
+	}
+
+	for (i = 0; i < np->num_ldg-j; i++) {
+
+		if(i < np->num_rx_rings)
+			sprintf(np->irq_name[i+j], "%s-rx-%d", np->dev->name, i);
+
+		else if(i < np->num_tx_rings + np->num_rx_rings) 
+			sprintf(np->irq_name[i+j], "%s-tx-%d", np->dev->name, 
+				i - np->num_rx_rings);
+	}
+}
+
 static int niu_request_irq(struct niu *np)
 {
 	int i, j, err;
 
+	niu_set_irq_name(np);
+
 	err = 0;
 	for (i = 0; i < np->num_ldg; i++) {
 		struct niu_ldg *lp = &np->ldg[i];
 
 		err = request_irq(lp->irq, niu_interrupt,
 				  IRQF_SHARED | IRQF_SAMPLE_RANDOM,
-				  np->dev->name, lp);
+				  np->irq_name[i], lp);
 		if (err)
 			goto out_free_irqs;
 
diff --git a/drivers/net/niu.h b/drivers/net/niu.h
index 180ca8a..cf449aa 100644
--- a/drivers/net/niu.h
+++ b/drivers/net/niu.h
@@ -3243,6 +3243,7 @@ struct niu {
 #define NIU_FLAGS_XMAC			0x00010000 /* 0=BMAC 1=XMAC */
 
 	u32				msg_enable;
+	char                            irq_name[NIU_NUM_RXCHAN+NIU_NUM_TXCHAN+3][IFNAMSIZ + 6];
 
 	/* Protects hw programming, and ring state.  */
 	spinlock_t			lock;

 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Naming interrupt vectors/niu
  2008-11-25 15:45 [PATCH] Naming interrupt vectors/niu Robert Olsson
@ 2008-11-25 15:58 ` Jesper Dangaard Brouer
  2008-11-25 17:19   ` Re : " SEBASTIEN LEGER
  2008-11-26  0:42 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Jesper Dangaard Brouer @ 2008-11-25 15:58 UTC (permalink / raw)
  To: Robert Olsson; +Cc: David Miller, netdev, Robert.Olsson


On Tue, 25 Nov 2008, Robert Olsson wrote:

> A patch to put names on the niu interrupt vectors according the syntax below.
> This is needed to assign correct affinity.
>
> > So on a multiqueue card with 2 RX queues and 2 TX queues we'd
> > have names like:
> >
> > 	eth0-rx-0
> > 	eth0-rx-1
> > 	eth0-tx-0
> > 	eth0-tx-1
>
>
> Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>

Tested-by: Jesper Dangaard Brouer <jdb@comx.dk>


I have tested the patch and it also works on the Quad 1G SUN NIC.
I really like the idea behind the patch, as it makes it a lot easier to 
get the smp affinity right...

Hilsen
   Jesper Brouer

--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen
Author of http://www.adsl-optimizer.dk
-------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re : [PATCH] Naming interrupt vectors/niu
  2008-11-25 15:58 ` Jesper Dangaard Brouer
@ 2008-11-25 17:19   ` SEBASTIEN LEGER
  0 siblings, 0 replies; 4+ messages in thread
From: SEBASTIEN LEGER @ 2008-11-25 17:19 UTC (permalink / raw)
  To: Jesper Dangaard Brouer, Robert Olsson; +Cc: netdev


Hi,

on multiqueue hardware, isn't RSS meant to bind packets from the same flow on a specific cpu?

So, does it make sense to control RX smp affinity from /proc/irq/*/smp_affinity on multiqueue adapters with RSS support?

thanks,

Sebastien

________________________________
De : Jesper Dangaard Brouer <hawk@diku.dk>
À : Robert Olsson <robert@robur.slu.se>
Cc : David Miller <davem@davemloft.net>; netdev@vger.kernel.org; Robert.Olsson@data.slu.se
Envoyé le : Mardi, 25 Novembre 2008, 16h58mn 06s
Objet : Re: [PATCH] Naming interrupt vectors/niu


On Tue, 25 Nov 2008, Robert Olsson wrote:

> A patch to put names on the niu interrupt vectors according the syntax below.
> This is needed to assign correct affinity.
>
> > So on a multiqueue card with 2 RX queues and 2 TX queues we'd
> > have names like:
> >
> >     eth0-rx-0
> >     eth0-rx-1
> >     eth0-tx-0
> >     eth0-tx-1
>
>
> Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>

Tested-by: Jesper Dangaard Brouer <jdb@comx.dk>


I have tested the patch and it also works on the Quad 1G SUN NIC.
I really like the idea behind the patch, as it makes it a lot easier to 
get the smp affinity right...

Hilsen
   Jesper Brouer

--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen
Author of http://www.adsl-optimizer.dk
-------------------------------------------------------------------
--
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



      

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Naming interrupt vectors/niu
  2008-11-25 15:45 [PATCH] Naming interrupt vectors/niu Robert Olsson
  2008-11-25 15:58 ` Jesper Dangaard Brouer
@ 2008-11-26  0:42 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2008-11-26  0:42 UTC (permalink / raw)
  To: robert; +Cc: netdev, Robert.Olsson

From: Robert Olsson <robert@robur.slu.se>
Date: Tue, 25 Nov 2008 16:45:12 +0100

>  A patch to put names on the niu interrupt vectors according the syntax below. 
>  This is needed to assign correct affinity.
> 
>  > So on a multiqueue card with 2 RX queues and 2 TX queues we'd
>  > have names like:
>  > 
>  > 	eth0-rx-0
>  > 	eth0-rx-1
>  > 	eth0-tx-0
>  > 	eth0-tx-1
> 
> 
> Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>

Applied with some minor coding style fixups, thanks Robert.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-26  0:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-25 15:45 [PATCH] Naming interrupt vectors/niu Robert Olsson
2008-11-25 15:58 ` Jesper Dangaard Brouer
2008-11-25 17:19   ` Re : " SEBASTIEN LEGER
2008-11-26  0:42 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).