aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-03-20 16:19:41 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-20 16:19:41 -0400
commit45ba5973c19fc1cd593ae249fda45c3f2badc6ef (patch)
tree046ca207b850a978178bf0d0b6e11ca48c9d63b8 /include/linux
parent8798998c2cdbc0df3c64e8845c1502ed93ef1ebd (diff)
parentdd41cc3bb90efd455df514899a5d3cf245182eb1 (diff)
Merge branch 'mlx4-next'
Or Gerlitz says: ==================== mlx4: Add support for single port VFs The mlx4 Firmware && driver expose both ports of the device through one PCI function. This can be non-optimal under virtualization schemes where the admin would like the VF to expose one interface to the VM, etc. This series from Matan Barak adds support for single ported VFs. Since all the VF interaction with the firmware passes through the PF driver, we can emulate to the VF they have one port, and further create a set of the VFs which act on port1 of the device and another set which acts on port2. Series done against net-next commit 3ab428a "netfilter: Add missing vmalloc.h include to nft_hash.c" Roland, we send this through netdev, but if you have comments, will love to hear them. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mlx4/device.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index f211b51dc726..6b3998396b99 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -84,6 +84,7 @@ enum {
84enum { 84enum {
85 MLX4_MAX_NUM_PF = 16, 85 MLX4_MAX_NUM_PF = 16,
86 MLX4_MAX_NUM_VF = 64, 86 MLX4_MAX_NUM_VF = 64,
87 MLX4_MAX_NUM_VF_P_PORT = 64,
87 MLX4_MFUNC_MAX = 80, 88 MLX4_MFUNC_MAX = 80,
88 MLX4_MAX_EQ_NUM = 1024, 89 MLX4_MAX_EQ_NUM = 1024,
89 MLX4_MFUNC_EQ_NUM = 4, 90 MLX4_MFUNC_EQ_NUM = 4,
@@ -664,6 +665,11 @@ struct mlx4_quotas {
664 int xrcd; 665 int xrcd;
665}; 666};
666 667
668struct mlx4_vf_dev {
669 u8 min_port;
670 u8 n_ports;
671};
672
667struct mlx4_dev { 673struct mlx4_dev {
668 struct pci_dev *pdev; 674 struct pci_dev *pdev;
669 unsigned long flags; 675 unsigned long flags;
@@ -679,6 +685,7 @@ struct mlx4_dev {
679 int oper_log_mgm_entry_size; 685 int oper_log_mgm_entry_size;
680 u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; 686 u64 regid_promisc_array[MLX4_MAX_PORTS + 1];
681 u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; 687 u64 regid_allmulti_array[MLX4_MAX_PORTS + 1];
688 struct mlx4_vf_dev *dev_vfs;
682}; 689};
683 690
684struct mlx4_eqe { 691struct mlx4_eqe {
@@ -1197,4 +1204,32 @@ int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn,
1197 1204
1198cycle_t mlx4_read_clock(struct mlx4_dev *dev); 1205cycle_t mlx4_read_clock(struct mlx4_dev *dev);
1199 1206
1207struct mlx4_active_ports {
1208 DECLARE_BITMAP(ports, MLX4_MAX_PORTS);
1209};
1210/* Returns a bitmap of the physical ports which are assigned to slave */
1211struct mlx4_active_ports mlx4_get_active_ports(struct mlx4_dev *dev, int slave);
1212
1213/* Returns the physical port that represents the virtual port of the slave, */
1214/* or a value < 0 in case of an error. If a slave has 2 ports, the identity */
1215/* mapping is returned. */
1216int mlx4_slave_convert_port(struct mlx4_dev *dev, int slave, int port);
1217
1218struct mlx4_slaves_pport {
1219 DECLARE_BITMAP(slaves, MLX4_MFUNC_MAX);
1220};
1221/* Returns a bitmap of all slaves that are assigned to port. */
1222struct mlx4_slaves_pport mlx4_phys_to_slaves_pport(struct mlx4_dev *dev,
1223 int port);
1224
1225/* Returns a bitmap of all slaves that are assigned exactly to all the */
1226/* the ports that are set in crit_ports. */
1227struct mlx4_slaves_pport mlx4_phys_to_slaves_pport_actv(
1228 struct mlx4_dev *dev,
1229 const struct mlx4_active_ports *crit_ports);
1230
1231/* Returns the slave's virtual port that represents the physical port. */
1232int mlx4_phys_to_slave_port(struct mlx4_dev *dev, int slave, int port);
1233
1234int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port);
1200#endif /* MLX4_DEVICE_H */ 1235#endif /* MLX4_DEVICE_H */