Commit 1da494cb authored by Moni Shoua's avatar Moni Shoua Committed by Doug Ledford

net/mlx4_core: Configure mlx4 hardware for mixed RoCE v1/v2 modes

If the hardware supports RoCE v2 (mixed with RoCE v1) mode, we enable
it. This is necessary in order to support RoCE v2.
Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent b699a859
...@@ -778,7 +778,10 @@ struct mlx4_set_port_general_context { ...@@ -778,7 +778,10 @@ struct mlx4_set_port_general_context {
u16 reserved1; u16 reserved1;
u8 v_ignore_fcs; u8 v_ignore_fcs;
u8 flags; u8 flags;
union {
u8 ignore_fcs; u8 ignore_fcs;
u8 roce_mode;
};
u8 reserved2; u8 reserved2;
__be16 mtu; __be16 mtu;
u8 pptx; u8 pptx;
......
...@@ -968,6 +968,8 @@ int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz) ...@@ -968,6 +968,8 @@ int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz)
return err; return err;
} }
#define SET_PORT_ROCE_2_FLAGS 0x10
#define MLX4_SET_PORT_ROCE_V1_V2 0x2
int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx) u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx)
{ {
...@@ -987,6 +989,11 @@ int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, ...@@ -987,6 +989,11 @@ int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
context->pprx = (pprx * (!pfcrx)) << 7; context->pprx = (pprx * (!pfcrx)) << 7;
context->pfcrx = pfcrx; context->pfcrx = pfcrx;
if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2) {
context->flags |= SET_PORT_ROCE_2_FLAGS;
context->roce_mode |=
MLX4_SET_PORT_ROCE_V1_V2 << 4;
}
in_mod = MLX4_SET_PORT_GENERAL << 8 | port; in_mod = MLX4_SET_PORT_GENERAL << 8 | port;
err = mlx4_cmd(dev, mailbox->dma, in_mod, MLX4_SET_PORT_ETH_OPCODE, err = mlx4_cmd(dev, mailbox->dma, in_mod, MLX4_SET_PORT_ETH_OPCODE,
MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment