aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/mad.c
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2012-08-03 04:40:49 -0400
committerRoland Dreier <roland@purestorage.com>2012-09-30 23:33:37 -0400
commita0c64a17aba88c29d55ba989b96ac6ccb1268f0a (patch)
treed76bf21edb1e70104a08c1bad21a566f2204e840 /drivers/infiniband/hw/mlx4/mad.c
parent993c401e207946fa56f69c51e39f015e7108497b (diff)
mlx4: Add alias_guid mechanism
For IB ports, we paravirtualize the GUID at index 0 on slaves. The GUID at index 0 seen by a slave is the actual GUID occupying the GUID table at the slave-id index. The driver, by default, requests at startup time that subnet manager populate its entire guid table with GUIDs. These guids are then mapped (paravirtualized) to the slaves, and appear for each slave as its GUID at index 0. Until each slave has such a guid, its port status is DOWN. The guid table is cached to support special QP paravirtualization, and event propagation to slaves on guid change (we test to see if the guid really changed before propagating an event to the slave). To support this caching, add capability to __mlx4_ib_query_gid() to obtain the network view (i.e., physical view) gid at index X, not just the host (paravirtualized) view. Based on a 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/mad.c')
-rw-r--r--drivers/infiniband/hw/mlx4/mad.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
index 2f13894299ee..b8cb25ebce50 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -791,8 +791,10 @@ void mlx4_ib_mad_cleanup(struct mlx4_ib_dev *dev)
791 791
792static void handle_client_rereg_event(struct mlx4_ib_dev *dev, u8 port_num) 792static void handle_client_rereg_event(struct mlx4_ib_dev *dev, u8 port_num)
793{ 793{
794 /* re-configure the mcg's */ 794 /* re-configure the alias-guid and mcg's */
795 if (mlx4_is_master(dev->dev)) { 795 if (mlx4_is_master(dev->dev)) {
796 mlx4_ib_invalidate_all_guid_record(dev, port_num);
797
796 if (!dev->sriov.is_going_down) 798 if (!dev->sriov.is_going_down)
797 mlx4_ib_mcg_port_cleanup(&dev->sriov.demux[port_num - 1], 0); 799 mlx4_ib_mcg_port_cleanup(&dev->sriov.demux[port_num - 1], 0);
798 } 800 }
@@ -1808,9 +1810,20 @@ int mlx4_ib_init_sriov(struct mlx4_ib_dev *dev)
1808 return 0; 1810 return 0;
1809 } 1811 }
1810 1812
1813 err = mlx4_ib_init_alias_guid_service(dev);
1814 if (err) {
1815 mlx4_ib_warn(&dev->ib_dev, "Failed init alias guid process.\n");
1816 goto paravirt_err;
1817 }
1818
1811 mlx4_ib_warn(&dev->ib_dev, "initializing demux service for %d qp1 clients\n", 1819 mlx4_ib_warn(&dev->ib_dev, "initializing demux service for %d qp1 clients\n",
1812 dev->dev->caps.sqp_demux); 1820 dev->dev->caps.sqp_demux);
1813 for (i = 0; i < dev->num_ports; i++) { 1821 for (i = 0; i < dev->num_ports; i++) {
1822 union ib_gid gid;
1823 err = __mlx4_ib_query_gid(&dev->ib_dev, i + 1, 0, &gid, 1);
1824 if (err)
1825 goto demux_err;
1826 dev->sriov.demux[i].guid_cache[0] = gid.global.interface_id;
1814 err = alloc_pv_object(dev, mlx4_master_func_num(dev->dev), i + 1, 1827 err = alloc_pv_object(dev, mlx4_master_func_num(dev->dev), i + 1,
1815 &dev->sriov.sqps[i]); 1828 &dev->sriov.sqps[i]);
1816 if (err) 1829 if (err)
@@ -1828,6 +1841,9 @@ demux_err:
1828 mlx4_ib_free_demux_ctx(&dev->sriov.demux[i]); 1841 mlx4_ib_free_demux_ctx(&dev->sriov.demux[i]);
1829 --i; 1842 --i;
1830 } 1843 }
1844 mlx4_ib_destroy_alias_guid_service(dev);
1845
1846paravirt_err:
1831 mlx4_ib_cm_paravirt_clean(dev, -1); 1847 mlx4_ib_cm_paravirt_clean(dev, -1);
1832 1848
1833 return err; 1849 return err;
@@ -1854,5 +1870,6 @@ void mlx4_ib_close_sriov(struct mlx4_ib_dev *dev)
1854 } 1870 }
1855 1871
1856 mlx4_ib_cm_paravirt_clean(dev, -1); 1872 mlx4_ib_cm_paravirt_clean(dev, -1);
1873 mlx4_ib_destroy_alias_guid_service(dev);
1857 } 1874 }
1858} 1875}