diff mbox

igb: warn if max_vfs limit is exceeded

Message ID 4D663ADD.4040708@redhat.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Stefan Assmann Feb. 24, 2011, 11:02 a.m. UTC
From: Stefan Assmann <sassmann@redhat.com>

Currently there's no warning printed when max_vfs > 7 is specified with
igb and the maximum of 7 is silently enforced. This patch prints a
warning and informs the user of the actions taken.

Signed-off-by: Stefan Assmann <sassmann@redhat.com>
---
 drivers/net/igb/igb_main.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

Comments

Kirsher, Jeffrey T Feb. 24, 2011, 11:23 a.m. UTC | #1
On Thu, 2011-02-24 at 03:02 -0800, Stefan Assmann wrote:
> From: Stefan Assmann <sassmann@redhat.com>
> 
> Currently there's no warning printed when max_vfs > 7 is specified
> with
> igb and the maximum of 7 is silently enforced. This patch prints a
> warning and informs the user of the actions taken.
> 
> Signed-off-by: Stefan Assmann <sassmann@redhat.com>
> ---
>  drivers/net/igb/igb_main.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-) 

Thanks for the patch Stefan.  I have added the patch to my igb queue of
patches.
diff mbox

Patch

diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index cb6bf7b..abeb2a6 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -2290,7 +2290,12 @@  static int __devinit igb_sw_init(struct igb_adapter *adapter)
 	switch (hw->mac.type) {
 	case e1000_82576:
 	case e1000_i350:
-		adapter->vfs_allocated_count = (max_vfs > 7) ? 7 : max_vfs;
+		if (max_vfs > 7) {
+			dev_warn(&pdev->dev,
+				 "Maximum of 7 VFs per PF, using max\n");
+			adapter->vfs_allocated_count = 7;
+		} else
+			adapter->vfs_allocated_count = max_vfs;
 		break;
 	default:
 		break;