Skip to content

Commit 793730b

Browse files
Yevgeny PetrilinRoland Dreier
authored andcommitted
mlx4_core: Don't perform SET_PORT command for Ethernet ports
The same operation is performed when the Ethernet driver initializes the port. Signed-off-by: Yevgeny Petrilin <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
1 parent 085343b commit 793730b

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/net/mlx4/port.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,20 +298,17 @@ int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port)
298298
{
299299
struct mlx4_cmd_mailbox *mailbox;
300300
int err;
301-
u8 is_eth = dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH;
302301

303302
mailbox = mlx4_alloc_cmd_mailbox(dev);
304303
if (IS_ERR(mailbox))
305304
return PTR_ERR(mailbox);
306305

307306
memset(mailbox->buf, 0, 256);
308-
if (is_eth) {
309-
((u8 *) mailbox->buf)[3] = 6;
310-
((__be16 *) mailbox->buf)[4] = cpu_to_be16(1 << 15);
311-
((__be16 *) mailbox->buf)[6] = cpu_to_be16(1 << 15);
312-
} else
313-
((__be32 *) mailbox->buf)[1] = dev->caps.ib_port_def_cap[port];
314-
err = mlx4_cmd(dev, mailbox->dma, port, is_eth, MLX4_CMD_SET_PORT,
307+
if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH)
308+
return 0;
309+
310+
((__be32 *) mailbox->buf)[1] = dev->caps.ib_port_def_cap[port];
311+
err = mlx4_cmd(dev, mailbox->dma, port, 0, MLX4_CMD_SET_PORT,
315312
MLX4_CMD_TIME_CLASS_B);
316313

317314
mlx4_free_cmd_mailbox(dev, mailbox);

0 commit comments

Comments
 (0)