aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/mcg.c
diff options
context:
space:
mode:
authorHadar Hen Zion <hadarh@mellanox.co.il>2012-07-05 00:03:45 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-07 19:23:05 -0400
commit8fcfb4db74352d3d447b7a559ad54f7577074d19 (patch)
tree3d60738ca8b0323189041305fb03128c839104bf /drivers/net/ethernet/mellanox/mlx4/mcg.c
parentc96d97f4d127b61def87b3ee056bec20cfc265d1 (diff)
net/mlx4_core: Add firmware commands to support device managed flow steering
Add support for firmware commands to attach/detach a new device managed steering mode. Such network steering rules allow the user to provide an L2/L3/L4 flow specification to the firmware and have the device to steer traffic that matches that specification to the provided QP. Signed-off-by: Hadar Hen Zion <hadarh@mellanox.co.il> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/mcg.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mcg.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index 319c9d45d59a..3c59a33a98a5 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -62,6 +62,35 @@ int mlx4_get_qp_per_mgm(struct mlx4_dev *dev)
62 return 4 * (mlx4_get_mgm_entry_size(dev) / 16 - 2); 62 return 4 * (mlx4_get_mgm_entry_size(dev) / 16 - 2);
63} 63}
64 64
65static int mlx4_QP_FLOW_STEERING_ATTACH(struct mlx4_dev *dev,
66 struct mlx4_cmd_mailbox *mailbox,
67 u32 size,
68 u64 *reg_id)
69{
70 u64 imm;
71 int err = 0;
72
73 err = mlx4_cmd_imm(dev, mailbox->dma, &imm, size, 0,
74 MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A,
75 MLX4_CMD_NATIVE);
76 if (err)
77 return err;
78 *reg_id = imm;
79
80 return err;
81}
82
83static int mlx4_QP_FLOW_STEERING_DETACH(struct mlx4_dev *dev, u64 regid)
84{
85 int err = 0;
86
87 err = mlx4_cmd(dev, regid, 0, 0,
88 MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A,
89 MLX4_CMD_NATIVE);
90
91 return err;
92}
93
65static int mlx4_READ_ENTRY(struct mlx4_dev *dev, int index, 94static int mlx4_READ_ENTRY(struct mlx4_dev *dev, int index,
66 struct mlx4_cmd_mailbox *mailbox) 95 struct mlx4_cmd_mailbox *mailbox)
67{ 96{