Patchwork Naming interrupt vectors/ixgbe

login
register
mail settings
Submitter Robert Olsson
Date Nov. 25, 2008, 3:49 p.m.
Message ID <18732.7795.484291.202338@robur.slu.se>
Download mbox | patch
Permalink /patch/10652/
State Accepted
Delegated to: David Miller
Headers show

Comments

Robert Olsson - Nov. 25, 2008, 3:49 p.m.
Same syntax for ixgbe driver.

Cheers
				--ro

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


--
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
Waskiewicz Jr, Peter P - Nov. 25, 2008, 6:20 p.m.
On Tue, 25 Nov 2008, Robert Olsson wrote:

> 
> Same syntax for ixgbe driver.
> 
> Cheers
> 				--ro
> 
> Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
> 
> 
> diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
> index 7548fb7..88717e6 100644
> --- a/drivers/net/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ixgbe/ixgbe_main.c
> @@ -1187,6 +1187,7 @@ static int ixgbe_request_msix_irqs(struct ixgbe_adapter *adapter)
>  	struct net_device *netdev = adapter->netdev;
>  	irqreturn_t (*handler)(int, void *);
>  	int i, vector, q_vectors, err;
> +	int ri=0, ti=0;

Tiny nit, ri = 0, ti = 0;

I can live with it though.

>  
>  	/* Decrement for Other and TCP Timer vectors */
>  	q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS;
> @@ -1201,10 +1202,19 @@ static int ixgbe_request_msix_irqs(struct ixgbe_adapter *adapter)
>                           &ixgbe_msix_clean_many)
>  	for (vector = 0; vector < q_vectors; vector++) {
>  		handler = SET_HANDLER(&adapter->q_vector[vector]);
> -		sprintf(adapter->name[vector], "%s:v%d-%s",
> -		        netdev->name, vector,
> -		        (handler == &ixgbe_msix_clean_rx) ? "Rx" :
> -		         ((handler == &ixgbe_msix_clean_tx) ? "Tx" : "TxRx"));
> +
> +		if(handler == &ixgbe_msix_clean_rx) {
> +			sprintf(adapter->name[vector], "%s-%s-%d",
> +				netdev->name, "rx", ri++);
> +		}
> +		else if(handler == &ixgbe_msix_clean_tx) {
> +			sprintf(adapter->name[vector], "%s-%s-%d",
> +				netdev->name, "tx", ti++);
> +		}
> +		else 
> +			sprintf(adapter->name[vector], "%s-%s-%d",
> +				netdev->name, "TxRx", vector);	
> +
>  		err = request_irq(adapter->msix_entries[vector].vector,
>  		                  handler, 0, adapter->name[vector],
>  		                  &(adapter->q_vector[vector]));

Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
--
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
David Miller - Nov. 26, 2008, 12:44 a.m.
From: "Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
Date: Tue, 25 Nov 2008 10:20:24 -0800 (Pacific Standard Time)

> On Tue, 25 Nov 2008, Robert Olsson wrote:
> 
> > 
> > Same syntax for ixgbe driver.
> > 
> > Cheers
> > 				--ro
> > 
> > Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
 ...
> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>

Applied with trailing whitespace fixed up.
--
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

Patch

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 7548fb7..88717e6 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -1187,6 +1187,7 @@  static int ixgbe_request_msix_irqs(struct ixgbe_adapter *adapter)
 	struct net_device *netdev = adapter->netdev;
 	irqreturn_t (*handler)(int, void *);
 	int i, vector, q_vectors, err;
+	int ri=0, ti=0;
 
 	/* Decrement for Other and TCP Timer vectors */
 	q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS;
@@ -1201,10 +1202,19 @@  static int ixgbe_request_msix_irqs(struct ixgbe_adapter *adapter)
                          &ixgbe_msix_clean_many)
 	for (vector = 0; vector < q_vectors; vector++) {
 		handler = SET_HANDLER(&adapter->q_vector[vector]);
-		sprintf(adapter->name[vector], "%s:v%d-%s",
-		        netdev->name, vector,
-		        (handler == &ixgbe_msix_clean_rx) ? "Rx" :
-		         ((handler == &ixgbe_msix_clean_tx) ? "Tx" : "TxRx"));
+
+		if(handler == &ixgbe_msix_clean_rx) {
+			sprintf(adapter->name[vector], "%s-%s-%d",
+				netdev->name, "rx", ri++);
+		}
+		else if(handler == &ixgbe_msix_clean_tx) {
+			sprintf(adapter->name[vector], "%s-%s-%d",
+				netdev->name, "tx", ti++);
+		}
+		else 
+			sprintf(adapter->name[vector], "%s-%s-%d",
+				netdev->name, "TxRx", vector);	
+
 		err = request_irq(adapter->msix_entries[vector].vector,
 		                  handler, 0, adapter->name[vector],
 		                  &(adapter->q_vector[vector]));