aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/mlx4_ib.h
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2012-08-03 04:40:51 -0400
committerRoland Dreier <roland@purestorage.com>2012-09-30 23:33:39 -0400
commitc1e7e466120b80ce49e91af0c9da1ce6dee4844a (patch)
treefc67dbaf01fff7e0f411315ee3b5a6923cf22354 /drivers/infiniband/hw/mlx4/mlx4_ib.h
parent2a4fae148cf4b60e73faf0a427302697917409d9 (diff)
IB/mlx4: Add iov directory in sysfs under the ib device
This directory is added only for the master -- slaves do not have it. The sysfs iov directory is used to manage and examine the port P_Key and guid paravirtualization. Under iov/ports, the administrator may examine the gid and P_Key tables as they are present in the device (and as are seen in the "network view" presented to the SM). Under the iov/<pci slot number> directories, the admin may map the index numbers in the physical tables (as under iov/ports) to the paravirtualized index numbers that guests see. For example, if the administrator, for port 1 on guest 2 maps physical pkey index 10 to virtual index 1, then that guest, whenever it uses its pkey index 1, will actually be using the real pkey index 10. Based on patch from Erez Shitrit <erezsh@mellanox.com> Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/mlx4_ib.h')
-rw-r--r--drivers/infiniband/hw/mlx4/mlx4_ib.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
index f3f75f8229a7..e57a220a4d55 100644
--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
+++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
@@ -427,6 +427,35 @@ struct pkey_mgt {
427 struct kobject *device_parent[MLX4_MFUNC_MAX]; 427 struct kobject *device_parent[MLX4_MFUNC_MAX];
428}; 428};
429 429
430struct mlx4_ib_iov_sysfs_attr {
431 void *ctx;
432 struct kobject *kobj;
433 unsigned long data;
434 u32 entry_num;
435 char name[15];
436 struct device_attribute dentry;
437 struct device *dev;
438};
439
440struct mlx4_ib_iov_sysfs_attr_ar {
441 struct mlx4_ib_iov_sysfs_attr dentries[3 * NUM_ALIAS_GUID_PER_PORT + 1];
442};
443
444struct mlx4_ib_iov_port {
445 char name[100];
446 u8 num;
447 struct mlx4_ib_dev *dev;
448 struct list_head list;
449 struct mlx4_ib_iov_sysfs_attr_ar *dentr_ar;
450 struct ib_port_attr attr;
451 struct kobject *cur_port;
452 struct kobject *admin_alias_parent;
453 struct kobject *gids_parent;
454 struct kobject *pkeys_parent;
455 struct kobject *mcgs_parent;
456 struct mlx4_ib_iov_sysfs_attr mcg_dentry;
457};
458
430struct mlx4_ib_dev { 459struct mlx4_ib_dev {
431 struct ib_device ib_dev; 460 struct ib_device ib_dev;
432 struct mlx4_dev *dev; 461 struct mlx4_dev *dev;
@@ -448,6 +477,10 @@ struct mlx4_ib_dev {
448 int counters[MLX4_MAX_PORTS]; 477 int counters[MLX4_MAX_PORTS];
449 int *eq_table; 478 int *eq_table;
450 int eq_added; 479 int eq_added;
480 struct kobject *iov_parent;
481 struct kobject *ports_parent;
482 struct kobject *dev_ports_parent[MLX4_MFUNC_MAX];
483 struct mlx4_ib_iov_port iov_ports[MLX4_MAX_PORTS];
451 struct pkey_mgt pkeys; 484 struct pkey_mgt pkeys;
452}; 485};
453 486
@@ -680,4 +713,14 @@ void mlx4_ib_update_cache_on_guid_change(struct mlx4_ib_dev *dev,
680 int block_num, u8 port_num, 713 int block_num, u8 port_num,
681 u8 *p_data); 714 u8 *p_data);
682 715
716int add_sysfs_port_mcg_attr(struct mlx4_ib_dev *device, int port_num,
717 struct attribute *attr);
718void del_sysfs_port_mcg_attr(struct mlx4_ib_dev *device, int port_num,
719 struct attribute *attr);
720ib_sa_comp_mask mlx4_ib_get_aguid_comp_mask_from_ix(int index);
721
722int mlx4_ib_device_register_sysfs(struct mlx4_ib_dev *device) ;
723
724void mlx4_ib_device_unregister_sysfs(struct mlx4_ib_dev *device);
725
683#endif /* MLX4_IB_H */ 726#endif /* MLX4_IB_H */