aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2014-03-27 08:02:02 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-28 16:29:35 -0400
commitb74757944d69f8cd7de5284fc7e8649d965361ab (patch)
treee0355259b27d8b72610b04ac5236ced8971d1a50
parentdae98cadf743daa480c357b7ba4410423c5f905f (diff)
net/mlx4: USe one wrapper that returns -EPERM
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>
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/cmd.c17
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4.h5
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/resource_tracker.c10
3 files changed, 4 insertions, 28 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index 516c1dd4963b..2fd61b60a5c5 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -800,16 +800,7 @@ static int mlx4_MAD_IFC_wrapper(struct mlx4_dev *dev, int slave,
800 vhcr->op, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); 800 vhcr->op, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE);
801} 801}
802 802
803static int MLX4_CMD_UPDATE_QP_wrapper(struct mlx4_dev *dev, int slave, 803static int mlx4_CMD_EPERM_wrapper(struct mlx4_dev *dev, int slave,
804 struct mlx4_vhcr *vhcr,
805 struct mlx4_cmd_mailbox *inbox,
806 struct mlx4_cmd_mailbox *outbox,
807 struct mlx4_cmd_info *cmd)
808{
809 return -EPERM;
810}
811
812static int MLX4_CMD_GET_OP_REQ_wrapper(struct mlx4_dev *dev, int slave,
813 struct mlx4_vhcr *vhcr, 804 struct mlx4_vhcr *vhcr,
814 struct mlx4_cmd_mailbox *inbox, 805 struct mlx4_cmd_mailbox *inbox,
815 struct mlx4_cmd_mailbox *outbox, 806 struct mlx4_cmd_mailbox *outbox,
@@ -1258,7 +1249,7 @@ static struct mlx4_cmd_info cmd_info[] = {
1258 .out_is_imm = false, 1249 .out_is_imm = false,
1259 .encode_slave_id = false, 1250 .encode_slave_id = false,
1260 .verify = NULL, 1251 .verify = NULL,
1261 .wrapper = MLX4_CMD_UPDATE_QP_wrapper 1252 .wrapper = mlx4_CMD_EPERM_wrapper
1262 }, 1253 },
1263 { 1254 {
1264 .opcode = MLX4_CMD_GET_OP_REQ, 1255 .opcode = MLX4_CMD_GET_OP_REQ,
@@ -1267,7 +1258,7 @@ static struct mlx4_cmd_info cmd_info[] = {
1267 .out_is_imm = false, 1258 .out_is_imm = false,
1268 .encode_slave_id = false, 1259 .encode_slave_id = false,
1269 .verify = NULL, 1260 .verify = NULL,
1270 .wrapper = MLX4_CMD_GET_OP_REQ_wrapper, 1261 .wrapper = mlx4_CMD_EPERM_wrapper,
1271 }, 1262 },
1272 { 1263 {
1273 .opcode = MLX4_CMD_CONF_SPECIAL_QP, 1264 .opcode = MLX4_CMD_CONF_SPECIAL_QP,
@@ -1378,7 +1369,7 @@ static struct mlx4_cmd_info cmd_info[] = {
1378 .out_is_imm = false, 1369 .out_is_imm = false,
1379 .encode_slave_id = false, 1370 .encode_slave_id = false,
1380 .verify = NULL, 1371 .verify = NULL,
1381 .wrapper = mlx4_FLOW_STEERING_IB_UC_QP_RANGE_wrapper 1372 .wrapper = mlx4_CMD_EPERM_wrapper
1382 }, 1373 },
1383}; 1374};
1384 1375
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index 9fca6c150de3..cf8be41abb36 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -1247,11 +1247,6 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave,
1247 struct mlx4_cmd_mailbox *inbox, 1247 struct mlx4_cmd_mailbox *inbox,
1248 struct mlx4_cmd_mailbox *outbox, 1248 struct mlx4_cmd_mailbox *outbox,
1249 struct mlx4_cmd_info *cmd); 1249 struct mlx4_cmd_info *cmd);
1250int mlx4_FLOW_STEERING_IB_UC_QP_RANGE_wrapper(struct mlx4_dev *dev, int slave,
1251 struct mlx4_vhcr *vhcr,
1252 struct mlx4_cmd_mailbox *inbox,
1253 struct mlx4_cmd_mailbox *outbox,
1254 struct mlx4_cmd_info *cmd);
1255 1250
1256int mlx4_get_mgm_entry_size(struct mlx4_dev *dev); 1251int mlx4_get_mgm_entry_size(struct mlx4_dev *dev);
1257int mlx4_get_qp_per_mgm(struct mlx4_dev *dev); 1252int mlx4_get_qp_per_mgm(struct mlx4_dev *dev);
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 2a33513a0e31..3b5f53ef29b2 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -4015,16 +4015,6 @@ int mlx4_QUERY_IF_STAT_wrapper(struct mlx4_dev *dev, int slave,
4015 return err; 4015 return err;
4016} 4016}
4017 4017
4018int mlx4_FLOW_STEERING_IB_UC_QP_RANGE_wrapper(struct mlx4_dev *dev, int slave,
4019 struct mlx4_vhcr *vhcr,
4020 struct mlx4_cmd_mailbox *inbox,
4021 struct mlx4_cmd_mailbox *outbox,
4022 struct mlx4_cmd_info *cmd)
4023{
4024 return -EPERM;
4025}
4026
4027
4028static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp) 4018static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp)
4029{ 4019{
4030 struct res_gid *rgid; 4020 struct res_gid *rgid;