Skip to contentSkip to conversation

mlx4_core: limiting VF port options

PATCH Applied Yevgeny Petrilin 2 participants 2 messages Dec 29, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 mlx4_core: limiting VF port options

At the moment VFs can only operate in Eth mode. In addition we don't want the VF to attempt link sensing, so we block this option as well.

---
 drivers/net/ethernet/mellanox/mlx4/fw.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx4/fw.c +4 -2
index e0639eb..8bcc66f 100644
@@ -657,6 +657,8 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave,
 	u8 port_type;
 	int err;
 
+#define MLX4_VF_PORT_ETH_ONLY_MASK	0xE6
+
 	err = mlx4_cmd_box(dev, 0, outbox->dma, vhcr->in_modifier, 0,
 			   MLX4_CMD_QUERY_PORT, MLX4_CMD_TIME_CLASS_B,
 			   MLX4_CMD_NATIVE);
@@ -671,8 +673,8 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave,
 		MLX4_GET(port_type, outbox->buf,
 			 QUERY_PORT_SUPPORTED_TYPE_OFFSET);
 
-		/* disable ib */
-		port_type &= 0xFE;
+		/* Allow only Eth port, no link sensing allowed */
+		port_type &= MLX4_VF_PORT_ETH_ONLY_MASK;
 
 		/* check eth is enabled for this port */
 		if (!(port_type & 2))
Signature · 1 line
1.7.7
maintainer Applied
#1 lore raw

From: Yevgeny Petrilin <[email protected]>
Date: Thu, 29 Dec 2011 19:42:39 +0200

Quoted 6 lines

At the moment VFs can only operate in Eth mode. In addition we don't want the VF to attempt link sensing, so we block this option as well.

Applied, but:

Quoted 1 line

+#define MLX4_VF_PORT_ETH_ONLY_MASK 0xE6

Why don't you just clearly define what all the port type bits mean instead of only defining some arbitrary combination of them?

What if people want to experiment with other bit mask settings? They can't do that if you don't document the layout fully and properly.