net/mlx4: USe one wrapper that returns -EPERM
authorOr Gerlitz <ogerlitz@mellanox.com>
Thu, 27 Mar 2014 12:02:02 +0000 (14:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Mar 2014 20:29:35 +0000 (16:29 -0400)
When a VF issues a firmware command which is disallowed for them, the PF
rerturns -EPERM from that command wrapper. Move to use one such wrapper
instance, instead of repeating the same code on such commands.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/cmd.c
drivers/net/ethernet/mellanox/mlx4/mlx4.h
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

index 516c1dd4963b133250506780fa4bb351e7d9443a..2fd61b60a5c50adb99a988ed74dc13014ef4e814 100644 (file)
@@ -800,16 +800,7 @@ static int mlx4_MAD_IFC_wrapper(struct mlx4_dev *dev, int slave,
                                    vhcr->op, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE);
 }
 
-static int MLX4_CMD_UPDATE_QP_wrapper(struct mlx4_dev *dev, int slave,
-                    struct mlx4_vhcr *vhcr,
-                    struct mlx4_cmd_mailbox *inbox,
-                    struct mlx4_cmd_mailbox *outbox,
-                    struct mlx4_cmd_info *cmd)
-{
-       return -EPERM;
-}
-
-static int MLX4_CMD_GET_OP_REQ_wrapper(struct mlx4_dev *dev, int slave,
+static int mlx4_CMD_EPERM_wrapper(struct mlx4_dev *dev, int slave,
                     struct mlx4_vhcr *vhcr,
                     struct mlx4_cmd_mailbox *inbox,
                     struct mlx4_cmd_mailbox *outbox,
@@ -1258,7 +1249,7 @@ static struct mlx4_cmd_info cmd_info[] = {
                .out_is_imm = false,
                .encode_slave_id = false,
                .verify = NULL,
-               .wrapper = MLX4_CMD_UPDATE_QP_wrapper
+               .wrapper = mlx4_CMD_EPERM_wrapper
        },
        {
                .opcode = MLX4_CMD_GET_OP_REQ,
@@ -1267,7 +1258,7 @@ static struct mlx4_cmd_info cmd_info[] = {
                .out_is_imm = false,
                .encode_slave_id = false,
                .verify = NULL,
-               .wrapper = MLX4_CMD_GET_OP_REQ_wrapper,
+               .wrapper = mlx4_CMD_EPERM_wrapper,
        },
        {
                .opcode = MLX4_CMD_CONF_SPECIAL_QP,
@@ -1378,7 +1369,7 @@ static struct mlx4_cmd_info cmd_info[] = {
                .out_is_imm = false,
                .encode_slave_id = false,
                .verify = NULL,
-               .wrapper = mlx4_FLOW_STEERING_IB_UC_QP_RANGE_wrapper
+               .wrapper = mlx4_CMD_EPERM_wrapper
        },
 };
 
index 9fca6c150de3481ca23f95a8b80712a9bacb89b5..cf8be41abb36f9e0b5324abce28d24e81f4963e8 100644 (file)
@@ -1247,11 +1247,6 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave,
                                         struct mlx4_cmd_mailbox *inbox,
                                         struct mlx4_cmd_mailbox *outbox,
                                         struct mlx4_cmd_info *cmd);
-int mlx4_FLOW_STEERING_IB_UC_QP_RANGE_wrapper(struct mlx4_dev *dev, int slave,
-                                             struct mlx4_vhcr *vhcr,
-                                             struct mlx4_cmd_mailbox *inbox,
-                                             struct mlx4_cmd_mailbox *outbox,
-                                             struct mlx4_cmd_info *cmd);
 
 int mlx4_get_mgm_entry_size(struct mlx4_dev *dev);
 int mlx4_get_qp_per_mgm(struct mlx4_dev *dev);
index 2a33513a0e31d63f8eb4276eb316edfbc77801b6..3b5f53ef29b292d6edcb027f6b64b9c108a3a03b 100644 (file)
@@ -4015,16 +4015,6 @@ int mlx4_QUERY_IF_STAT_wrapper(struct mlx4_dev *dev, int slave,
        return err;
 }
 
-int mlx4_FLOW_STEERING_IB_UC_QP_RANGE_wrapper(struct mlx4_dev *dev, int slave,
-                                             struct mlx4_vhcr *vhcr,
-                                             struct mlx4_cmd_mailbox *inbox,
-                                             struct mlx4_cmd_mailbox *outbox,
-                                             struct mlx4_cmd_info *cmd)
-{
-       return -EPERM;
-}
-
-
 static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp)
 {
        struct res_gid *rgid;