Skip to content

Commit

Permalink
mlx4_core: Handle multi-physical function devices
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yevgeny Petrilin authored and Roland Dreier committed Jul 6, 2009
1 parent 626f380 commit cc4ac2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion drivers/net/mlx4/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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) ||
Expand Down
5 changes: 4 additions & 1 deletion drivers/net/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,10 @@ static int mlx4_init_hca(struct mlx4_dev *dev)

err = mlx4_QUERY_FW(dev);
if (err) {
mlx4_err(dev, "QUERY_FW command failed, aborting.\n");
if (err == -EACCES)
mlx4_info(dev, "non-primary physical function, skipping.\n");
else
mlx4_err(dev, "QUERY_FW command failed, aborting.\n");
return err;
}

Expand Down

0 comments on commit cc4ac2e

Please sign in to comment.