aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/mlx4.h
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2012-06-19 04:21:44 -0400
committerRoland Dreier <roland@purestorage.com>2012-07-11 14:52:23 -0400
commit6634961c14d38ef64ec284c07aecb03d3dd03b4a (patch)
treea91bc4fa44848799c3035a9bfea1b288c2edac82 /drivers/net/ethernet/mellanox/mlx4/mlx4.h
parent105c320f6ac37af30252577d419e47b39edb5843 (diff)
mlx4: Put physical GID and P_Key table sizes in mlx4_phys_caps struct and paravirtualize them
To allow easy paravirtualization of P_Key and GID table sizes, keep paravirtualized sizes in mlx4_dev->caps, but save the actual physical sizes from FW in struct: mlx4_dev->phys_cap. In addition, in SR-IOV mode, do the following: 1. Reduce reported P_Key table size by 1. This is done to reserve the highest P_Key index for internal use, for declaring an invalid P_Key in P_Key paravirtualization. We require a P_Key index which always contain an invalid P_Key value for this purpose (i.e., one which cannot be modified by the subnet manager). The way to do this is to reduce the P_Key table size reported to the subnet manager by 1, so that it will not attempt to access the P_Key at index #127. 2. Paravirtualize the GID table size to 1. Thus, each guest sees only a single GID (at its paravirtualized index 0). In addition, since we are paravirtualizing the GID table size to 1, we add paravirtualization of the master GID event here (i.e., we do not do ib_dispatch_event() for the GUID change event on the master, since its (only) GUID never changes). Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/mlx4.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index 4d11d12b9db4..cde6e511899f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -969,7 +969,7 @@ int mlx4_change_port_types(struct mlx4_dev *dev,
969void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table); 969void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table);
970void mlx4_init_vlan_table(struct mlx4_dev *dev, struct mlx4_vlan_table *table); 970void mlx4_init_vlan_table(struct mlx4_dev *dev, struct mlx4_vlan_table *table);
971 971
972int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port); 972int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz);
973/* resource tracker functions*/ 973/* resource tracker functions*/
974int mlx4_get_slave_from_resource_id(struct mlx4_dev *dev, 974int mlx4_get_slave_from_resource_id(struct mlx4_dev *dev,
975 enum mlx4_resource resource_type, 975 enum mlx4_resource resource_type,
@@ -1012,6 +1012,8 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave,
1012 struct mlx4_cmd_info *cmd); 1012 struct mlx4_cmd_info *cmd);
1013int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps); 1013int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps);
1014 1014
1015int mlx4_get_slave_pkey_gid_tbl_len(struct mlx4_dev *dev, u8 port,
1016 int *gid_tbl_len, int *pkey_tbl_len);
1015 1017
1016int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, 1018int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
1017 struct mlx4_vhcr *vhcr, 1019 struct mlx4_vhcr *vhcr,