diff options
author | Hadar Hen Zion <hadarh@mellanox.com> | 2013-12-19 14:20:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-19 19:04:43 -0500 |
commit | eb17711bc1d6611e934af5b6dabc225936084128 (patch) | |
tree | 7ad1db69ca60c28f7a5a97171e7af83f238bf351 | |
parent | 73e74ab4e0d030f28d640507998156a22d4211f8 (diff) |
net/mlx4_core: Introduce nic_info new flag in QUERY_FUNC_CAP
Set nic_info field in QUERY_FUNC_CAP, which designates
supplementary NIC information is provided by the hypervisor.
When set, the following fields are valid: nic_num_rings,
nic_indirection_tbl_sz, cur_mac and phys_port_id.
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/fw.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/fw.h | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 58ca7de49328..bfe91aebea8e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
@@ -217,10 +217,15 @@ int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave, | |||
217 | 217 | ||
218 | #define QUERY_FUNC_CAP_FLAGS1_FORCE_MAC 0x40 | 218 | #define QUERY_FUNC_CAP_FLAGS1_FORCE_MAC 0x40 |
219 | #define QUERY_FUNC_CAP_FLAGS1_FORCE_VLAN 0x80 | 219 | #define QUERY_FUNC_CAP_FLAGS1_FORCE_VLAN 0x80 |
220 | #define QUERY_FUNC_CAP_FLAGS1_NIC_INFO 0x10 | ||
220 | 221 | ||
221 | #define QUERY_FUNC_CAP_FLAGS0_FORCE_PHY_WQE_GID 0x80 | 222 | #define QUERY_FUNC_CAP_FLAGS0_FORCE_PHY_WQE_GID 0x80 |
222 | 223 | ||
223 | if (vhcr->op_modifier == 1) { | 224 | if (vhcr->op_modifier == 1) { |
225 | /* Set nic_info bit to mark new fields support */ | ||
226 | field = QUERY_FUNC_CAP_FLAGS1_NIC_INFO; | ||
227 | MLX4_PUT(outbox->buf, field, QUERY_FUNC_CAP_FLAGS1_OFFSET); | ||
228 | |||
224 | field = vhcr->in_modifier; /* phys-port = logical-port */ | 229 | field = vhcr->in_modifier; /* phys-port = logical-port */ |
225 | MLX4_PUT(outbox->buf, field, QUERY_FUNC_CAP_PHYS_PORT_OFFSET); | 230 | MLX4_PUT(outbox->buf, field, QUERY_FUNC_CAP_PHYS_PORT_OFFSET); |
226 | 231 | ||
@@ -385,15 +390,15 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, | |||
385 | goto out; | 390 | goto out; |
386 | } | 391 | } |
387 | 392 | ||
393 | MLX4_GET(func_cap->flags1, outbox, QUERY_FUNC_CAP_FLAGS1_OFFSET); | ||
388 | if (dev->caps.port_type[gen_or_port] == MLX4_PORT_TYPE_ETH) { | 394 | if (dev->caps.port_type[gen_or_port] == MLX4_PORT_TYPE_ETH) { |
389 | MLX4_GET(field, outbox, QUERY_FUNC_CAP_FLAGS1_OFFSET); | 395 | if (func_cap->flags1 & QUERY_FUNC_CAP_FLAGS1_OFFSET) { |
390 | if (field & QUERY_FUNC_CAP_FLAGS1_FORCE_VLAN) { | ||
391 | mlx4_err(dev, "VLAN is enforced on this port\n"); | 396 | mlx4_err(dev, "VLAN is enforced on this port\n"); |
392 | err = -EPROTONOSUPPORT; | 397 | err = -EPROTONOSUPPORT; |
393 | goto out; | 398 | goto out; |
394 | } | 399 | } |
395 | 400 | ||
396 | if (field & QUERY_FUNC_CAP_FLAGS1_FORCE_MAC) { | 401 | if (func_cap->flags1 & QUERY_FUNC_CAP_FLAGS1_FORCE_MAC) { |
397 | mlx4_err(dev, "Force mac is enabled on this port\n"); | 402 | mlx4_err(dev, "Force mac is enabled on this port\n"); |
398 | err = -EPROTONOSUPPORT; | 403 | err = -EPROTONOSUPPORT; |
399 | goto out; | 404 | goto out; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.h b/drivers/net/ethernet/mellanox/mlx4/fw.h index a0a368b7c939..9d952983b076 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.h +++ b/drivers/net/ethernet/mellanox/mlx4/fw.h | |||
@@ -140,6 +140,7 @@ struct mlx4_func_cap { | |||
140 | u32 qp1_proxy_qpn; | 140 | u32 qp1_proxy_qpn; |
141 | u8 physical_port; | 141 | u8 physical_port; |
142 | u8 port_flags; | 142 | u8 port_flags; |
143 | u8 flags1; | ||
143 | }; | 144 | }; |
144 | 145 | ||
145 | struct mlx4_adapter { | 146 | struct mlx4_adapter { |