net/mlx5: Reorder few command cases to reflect their natural order
authorOr Gerlitz <ogerlitz@mellanox.com>
Thu, 19 Jan 2017 17:37:06 +0000 (19:37 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 28 Mar 2017 12:34:03 +0000 (15:34 +0300)
Move the commands related to scheduling elements and vport qos to
a suitable location (according to the MLX5_CMD_OP enum values) in
the command string and internal error helpers.

This patch doesn't change any functionality.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c

index a380353a78c2d349291e33aa3a1ef7af837111c2..c3c6e931cc3589a5faeaa871e769443cf53534ff 100644 (file)
@@ -279,6 +279,8 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
        case MLX5_CMD_OP_DESTROY_XRC_SRQ:
        case MLX5_CMD_OP_DESTROY_DCT:
        case MLX5_CMD_OP_DEALLOC_Q_COUNTER:
+       case MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT:
+       case MLX5_CMD_OP_DESTROY_QOS_PARA_VPORT:
        case MLX5_CMD_OP_DEALLOC_PD:
        case MLX5_CMD_OP_DEALLOC_UAR:
        case MLX5_CMD_OP_DETACH_FROM_MCG:
@@ -305,8 +307,6 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
        case MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY:
        case MLX5_CMD_OP_SET_FLOW_TABLE_ROOT:
        case MLX5_CMD_OP_DEALLOC_ENCAP_HEADER:
-       case MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT:
-       case MLX5_CMD_OP_DESTROY_QOS_PARA_VPORT:
                return MLX5_CMD_STAT_OK;
 
        case MLX5_CMD_OP_QUERY_HCA_CAP:
@@ -363,6 +363,10 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
        case MLX5_CMD_OP_QUERY_Q_COUNTER:
        case MLX5_CMD_OP_SET_RATE_LIMIT:
        case MLX5_CMD_OP_QUERY_RATE_LIMIT:
+       case MLX5_CMD_OP_CREATE_SCHEDULING_ELEMENT:
+       case MLX5_CMD_OP_QUERY_SCHEDULING_ELEMENT:
+       case MLX5_CMD_OP_MODIFY_SCHEDULING_ELEMENT:
+       case MLX5_CMD_OP_CREATE_QOS_PARA_VPORT:
        case MLX5_CMD_OP_ALLOC_PD:
        case MLX5_CMD_OP_ALLOC_UAR:
        case MLX5_CMD_OP_CONFIG_INT_MODERATION:
@@ -414,10 +418,6 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
        case MLX5_CMD_OP_ALLOC_FLOW_COUNTER:
        case MLX5_CMD_OP_QUERY_FLOW_COUNTER:
        case MLX5_CMD_OP_ALLOC_ENCAP_HEADER:
-       case MLX5_CMD_OP_CREATE_SCHEDULING_ELEMENT:
-       case MLX5_CMD_OP_QUERY_SCHEDULING_ELEMENT:
-       case MLX5_CMD_OP_MODIFY_SCHEDULING_ELEMENT:
-       case MLX5_CMD_OP_CREATE_QOS_PARA_VPORT:
                *status = MLX5_DRIVER_STATUS_ABORTED;
                *synd = MLX5_DRIVER_SYND;
                return -EIO;
@@ -501,6 +501,12 @@ const char *mlx5_command_str(int command)
        MLX5_COMMAND_STR_CASE(QUERY_Q_COUNTER);
        MLX5_COMMAND_STR_CASE(SET_RATE_LIMIT);
        MLX5_COMMAND_STR_CASE(QUERY_RATE_LIMIT);
+       MLX5_COMMAND_STR_CASE(CREATE_SCHEDULING_ELEMENT);
+       MLX5_COMMAND_STR_CASE(DESTROY_SCHEDULING_ELEMENT);
+       MLX5_COMMAND_STR_CASE(QUERY_SCHEDULING_ELEMENT);
+       MLX5_COMMAND_STR_CASE(MODIFY_SCHEDULING_ELEMENT);
+       MLX5_COMMAND_STR_CASE(CREATE_QOS_PARA_VPORT);
+       MLX5_COMMAND_STR_CASE(DESTROY_QOS_PARA_VPORT);
        MLX5_COMMAND_STR_CASE(ALLOC_PD);
        MLX5_COMMAND_STR_CASE(DEALLOC_PD);
        MLX5_COMMAND_STR_CASE(ALLOC_UAR);
@@ -576,12 +582,6 @@ const char *mlx5_command_str(int command)
        MLX5_COMMAND_STR_CASE(MODIFY_FLOW_TABLE);
        MLX5_COMMAND_STR_CASE(ALLOC_ENCAP_HEADER);
        MLX5_COMMAND_STR_CASE(DEALLOC_ENCAP_HEADER);
-       MLX5_COMMAND_STR_CASE(CREATE_SCHEDULING_ELEMENT);
-       MLX5_COMMAND_STR_CASE(DESTROY_SCHEDULING_ELEMENT);
-       MLX5_COMMAND_STR_CASE(QUERY_SCHEDULING_ELEMENT);
-       MLX5_COMMAND_STR_CASE(MODIFY_SCHEDULING_ELEMENT);
-       MLX5_COMMAND_STR_CASE(CREATE_QOS_PARA_VPORT);
-       MLX5_COMMAND_STR_CASE(DESTROY_QOS_PARA_VPORT);
        default: return "unknown command opcode";
        }
 }