mlx4_core: Changing link sensing logic
PATCH 2/5 mlx4_core: Changing link sensing logic
From: Yevgeny Petrilin <[email protected]>
New FW can give clues to driver regarding default port type and whether or not we should default to link sensing on the port.
2 bits are added to QUERY_PORT command:
1. suggested_type: This bit gives a hint whether the default port type should be IB or Ethernet.
The driver will use this hint in case the user didn't specify explicitly the link layer type he wants to set.
2. default_sense: If this bit is set, we would sense the port type on start-up and default the port to link sensing
Signed-off-by Yevgeny Petrilin <[email protected]>
--- drivers/net/ethernet/mellanox/mlx4/fw.c | 2 + drivers/net/ethernet/mellanox/mlx4/fw.h | 2 + drivers/net/ethernet/mellanox/mlx4/main.c | 50 +++++++++++++++++++--------- include/linux/mlx4/device.h | 2 + 4 files changed, 40 insertions(+), 16 deletions(-)
drivers/net/ethernet/mellanox/mlx4/fw.c +2 -0
@@ -577,6 +577,8 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)MLX4_GET (field, outbox,QUERY_PORT_SUPPORTED_TYPE_OFFSET ); dev_cap->supported_port_types[i] = field &3 ; + dev_cap->suggested_type[i] = (field >>3 ) &1 ; + dev_cap->default_sense[i] = (field >>4 ) &1 ;MLX4_GET (field, outbox,QUERY_PORT_MTU_OFFSET ); dev_cap->ib_mtu[i] = field &0xf ;MLX4_GET (field, outbox,QUERY_PORT_WIDTH_OFFSET );
drivers/net/ethernet/mellanox/mlx4/fw.h +2 -0
@@ -111,6 +111,8 @@ struct mlx4_dev_cap {u64 max_icm_sz;int max_gso_sz;u8 supported_port_types[MLX4_MAX_PORTS +1 ]; +u8 suggested_type[MLX4_MAX_PORTS +1 ]; +u8 default_sense[MLX4_MAX_PORTS +1 ];u8 log_max_macs[MLX4_MAX_PORTS +1 ];u8 log_max_vlans[MLX4_MAX_PORTS +1 ];u32 max_counters;
drivers/net/ethernet/mellanox/mlx4/main.c +34 -16
84 lines not on this page · raw message
include/linux/mlx4/device.h +2 -0
@@ -303,6 +303,8 @@ struct mlx4_caps {int log_num_prios;enum mlx4_port_type port_type[MLX4_MAX_PORTS +1 ];u8 supported_type[MLX4_MAX_PORTS +1 ]; +u8 suggested_type[MLX4_MAX_PORTS +1 ]; +u8 default_sense[MLX4_MAX_PORTS +1 ];u32 port_mask[MLX4_MAX_PORTS +1 ];enum mlx4_port_type possible_type[MLX4_MAX_PORTS +1 ];u32 max_counters;
Signature · 1 line
1.7.7