Patchwork vmxnet3: Fix log messages and corrects some typos

login
register
mail settings
Submitter Shreyas Bhatewara
Date Feb. 29, 2012, 6:55 a.m.
Message ID <alpine.LRH.2.00.1202282209500.19873@sbhatewara-dev1.eng.vmware.com>
Download mbox | patch
Permalink /patch/143672/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Shreyas Bhatewara - Feb. 29, 2012, 6:55 a.m.
Fix log messages and corrects some typos

Change logging of failure to enable MSI/MSI-X to display device's PCI
address instead of eth%d. Rectify a typo.

Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.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
Joe Perches - Feb. 29, 2012, 7:02 a.m.
On Tue, 2012-02-28 at 22:55 -0800, Shreyas Bhatewara wrote:
> Fix log messages and corrects some typos

Please don't split formats.

> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c

> @@ -2709,8 +2709,8 @@ vmxnet3_acquire_msix_vectors(struct vmxnet3_adapter *adapter,
>  			adapter->intr.num_intrs = vectors;
>  			return 0;
>  		} else if (err < 0) {
> -			printk(KERN_ERR "Failed to enable MSI-X for %s, error"
> -			       " %d\n",	adapter->netdev->name, err);
> +			netdev_info(adapter->netdev, "Failed to enable MSI-X, "
> +				    "error: %d\n", err);

Why change from err to info?
And perhaps this is better as:
			netdev_err(adapter->netdev,
				   "Failed to enable MSI-X for %s, error: %d\n",
				   err);
[]
> @@ -2718,15 +2718,15 @@ vmxnet3_acquire_msix_vectors(struct vmxnet3_adapter *adapter,
>  			/* If fails to enable required number of MSI-x vectors
>  			 * try enabling minimum number of vectors required.
>  			 */
> +			netdev_info(adapter->netdev, "Failed to enable %d MSI-X"
> +				    ", trying %d instead\n", vectors,
> +				    vector_threshold);
[] 
> -	printk(KERN_INFO "Number of MSI-X interrupts which can be allocatedi"
> -	       " are lower than min threshold required.\n");
> +	netdev_info(adapter->netdev, "Number of MSI-X interrupts which can be "
> +		    " allocated are lower than min threshold required.\n");

This is an example of why not to split formats.
You added 2 spaces between be and allocated.

>  	return err;
>  }
>  
> @@ -2792,8 +2792,8 @@ vmxnet3_alloc_intr_resources(struct vmxnet3_adapter *adapter)
>  			return;
>  
>  		/* If we cannot allocate MSIx vectors use only one rx queue */
> -		printk(KERN_INFO "Failed to enable MSI-X for %s, error %d."
> -		       "#rx queues : 1, try MSI\n", adapter->netdev->name, err);
> +		netdev_info(adapter->netdev, "Failed to enable MSI-X, error %d."
> +			    "Limiting #rx queues to 1, try MSI.\n", err);

Need a space after %d.

cheers, Joe

--
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/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index de7fc34..51ec299 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -2709,8 +2709,8 @@  vmxnet3_acquire_msix_vectors(struct vmxnet3_adapter *adapter,
 			adapter->intr.num_intrs = vectors;
 			return 0;
 		} else if (err < 0) {
-			printk(KERN_ERR "Failed to enable MSI-X for %s, error"
-			       " %d\n",	adapter->netdev->name, err);
+			netdev_info(adapter->netdev, "Failed to enable MSI-X, "
+				    "error: %d\n", err);
 			vectors = 0;
 		} else if (err < vector_threshold) {
 			break;
@@ -2718,15 +2718,15 @@  vmxnet3_acquire_msix_vectors(struct vmxnet3_adapter *adapter,
 			/* If fails to enable required number of MSI-x vectors
 			 * try enabling minimum number of vectors required.
 			 */
+			netdev_info(adapter->netdev, "Failed to enable %d MSI-X"
+				    ", trying %d instead\n", vectors,
+				    vector_threshold);
 			vectors = vector_threshold;
-			printk(KERN_ERR "Failed to enable %d MSI-X for %s, try"
-			       " %d instead\n", vectors, adapter->netdev->name,
-			       vector_threshold);
 		}
 	}
 
-	printk(KERN_INFO "Number of MSI-X interrupts which can be allocatedi"
-	       " are lower than min threshold required.\n");
+	netdev_info(adapter->netdev, "Number of MSI-X interrupts which can be "
+		    " allocated are lower than min threshold required.\n");
 	return err;
 }
 
@@ -2792,8 +2792,8 @@  vmxnet3_alloc_intr_resources(struct vmxnet3_adapter *adapter)
 			return;
 
 		/* If we cannot allocate MSIx vectors use only one rx queue */
-		printk(KERN_INFO "Failed to enable MSI-X for %s, error %d."
-		       "#rx queues : 1, try MSI\n", adapter->netdev->name, err);
+		netdev_info(adapter->netdev, "Failed to enable MSI-X, error %d."
+			    "Limiting #rx queues to 1, try MSI.\n", err);
 
 		adapter->intr.type = VMXNET3_IT_MSI;
 	}