mlx4_core: Handle multi-physical function devices

Previous thread: mlx4_core: Add new ConnectX EN PCI ID 0x6764 by Linux Kernel Mailing List on Tuesday, July 14, 2009 - 6:59 pm. (1 message)

Next thread: x86: Remove spurious printk level from segfault message by Linux Kernel Mailing List on Tuesday, July 14, 2009 - 6:59 pm. (1 message)
From: Linux Kernel Mailing List
Date: Tuesday, July 14, 2009 - 6:59 pm

Gitweb:     http://git.kernel.org/linus/cc4ac2e7fb90dfbbbd5a42df0879733f787e4690
Commit:     cc4ac2e7fb90dfbbbd5a42df0879733f787e4690
Parent:     626f380d0b264a1e40237f5a2a3dffc5d14f256e
Author:     Yevgeny Petrilin <yevgenyp@mellanox.co.il>
AuthorDate: Mon Jul 6 16:10:03 2009 -0700
Committer:  Roland Dreier <rolandd@cisco.com>
CommitDate: Mon Jul 6 16:10:03 2009 -0700

    mlx4_core: Handle multi-physical function devices
    
    MT26468 (PCI ID 0x6764) devices can expose multiple physical
    functions.  The current driver only handles the primary physical
    function.  For other functions, the QUERY_FW firmware command will
    fail with the CMD_STAT_MULTI_FUNC_REQ error code.  Don't try to drive
    such devices, but print a message saying the driver is skipping those
    devices rather than just "QUERY_FW command failed."
    
    Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
    
    [ Rather than keeping unsupported devices bound to the driver, simply
      print a more informative error message and exit - Roland ]
    
    Signed-off-by: Roland Dreier <rolandd@cisco.com>
---
 drivers/net/mlx4/cmd.c  |    5 ++++-
 drivers/net/mlx4/main.c |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx4/cmd.c b/drivers/net/mlx4/cmd.c
index 2845a05..65ec77d 100644
--- a/drivers/net/mlx4/cmd.c
+++ b/drivers/net/mlx4/cmd.c
@@ -80,7 +80,9 @@ enum {
 	/* Bad management packet (silently discarded): */
 	CMD_STAT_BAD_PKT	= 0x30,
 	/* More outstanding CQEs in CQ than new CQ size: */
-	CMD_STAT_BAD_SIZE	= 0x40
+	CMD_STAT_BAD_SIZE	= 0x40,
+	/* Multi Function device support required: */
+	CMD_STAT_MULTI_FUNC_REQ	= 0x50,
 };
 
 enum {
@@ -128,6 +130,7 @@ static int mlx4_status_to_errno(u8 status)
 		[CMD_STAT_LAM_NOT_PRE]	  = -EAGAIN,
 		[CMD_STAT_BAD_PKT]	  = -EINVAL,
 		[CMD_STAT_BAD_SIZE]	  = -ENOMEM,
+		[CMD_STAT_MULTI_FUNC_REQ] = -EACCES,
 	};
 
 	if (status >= ARRAY_SIZE(trans_table) ||
diff --git ...
Previous thread: mlx4_core: Add new ConnectX EN PCI ID 0x6764 by Linux Kernel Mailing List on Tuesday, July 14, 2009 - 6:59 pm. (1 message)

Next thread: x86: Remove spurious printk level from segfault message by Linux Kernel Mailing List on Tuesday, July 14, 2009 - 6:59 pm. (1 message)