Lines Matching refs:ib_dev
124 static void dispatch_gid_change_event(struct ib_device *ib_dev, u32 port) in dispatch_gid_change_event() argument
128 event.device = ib_dev; in dispatch_gid_change_event()
382 static void del_gid(struct ib_device *ib_dev, u32 port, in del_gid() argument
390 dev_dbg(&ib_dev->dev, "%s port=%u index=%d gid %pI6\n", __func__, port, in del_gid()
399 if (!rdma_protocol_roce(ib_dev, port)) in del_gid()
403 if (rdma_cap_roce_gid_table(ib_dev, port)) in del_gid()
404 ib_dev->ops.del_gid(&entry->attr, &entry->context); in del_gid()
546 static int __ib_cache_gid_add(struct ib_device *ib_dev, u32 port, in __ib_cache_gid_add() argument
562 table = rdma_gid_table(ib_dev, port); in __ib_cache_gid_add()
574 attr->device = ib_dev; in __ib_cache_gid_add()
580 dispatch_gid_change_event(ib_dev, port); in __ib_cache_gid_add()
590 int ib_cache_gid_add(struct ib_device *ib_dev, u32 port, in ib_cache_gid_add() argument
597 return __ib_cache_gid_add(ib_dev, port, gid, attr, mask, false); in ib_cache_gid_add()
601 _ib_cache_gid_del(struct ib_device *ib_dev, u32 port, in _ib_cache_gid_del() argument
609 table = rdma_gid_table(ib_dev, port); in _ib_cache_gid_del()
619 del_gid(ib_dev, port, table, ix); in _ib_cache_gid_del()
620 dispatch_gid_change_event(ib_dev, port); in _ib_cache_gid_del()
630 int ib_cache_gid_del(struct ib_device *ib_dev, u32 port, in ib_cache_gid_del() argument
638 return _ib_cache_gid_del(ib_dev, port, gid, attr, mask, false); in ib_cache_gid_del()
641 int ib_cache_gid_del_all_netdev_gids(struct ib_device *ib_dev, u32 port, in ib_cache_gid_del_all_netdev_gids() argument
648 table = rdma_gid_table(ib_dev, port); in ib_cache_gid_del_all_netdev_gids()
655 del_gid(ib_dev, port, table, ix); in ib_cache_gid_del_all_netdev_gids()
663 dispatch_gid_change_event(ib_dev, port); in ib_cache_gid_del_all_netdev_gids()
683 rdma_find_gid_by_port(struct ib_device *ib_dev, in rdma_find_gid_by_port() argument
696 if (!rdma_is_port_valid(ib_dev, port)) in rdma_find_gid_by_port()
699 table = rdma_gid_table(ib_dev, port); in rdma_find_gid_by_port()
737 struct ib_device *ib_dev, const union ib_gid *gid, u32 port, in rdma_find_gid_by_filter() argument
747 if (!rdma_is_port_valid(ib_dev, port)) in rdma_find_gid_by_filter()
750 table = rdma_gid_table(ib_dev, port); in rdma_find_gid_by_filter()
817 static void cleanup_gid_table_port(struct ib_device *ib_dev, u32 port, in cleanup_gid_table_port() argument
828 del_gid(ib_dev, port, table, i); in cleanup_gid_table_port()
833 void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u32 port, in ib_cache_gid_set_default_gid() argument
857 __ib_cache_gid_add(ib_dev, port, &gid, in ib_cache_gid_set_default_gid()
860 _ib_cache_gid_del(ib_dev, port, &gid, in ib_cache_gid_set_default_gid()
866 static void gid_table_reserve_default(struct ib_device *ib_dev, u32 port, in gid_table_reserve_default() argument
873 roce_gid_type_mask = roce_gid_type_mask_support(ib_dev, port); in gid_table_reserve_default()
881 static void gid_table_release_one(struct ib_device *ib_dev) in gid_table_release_one() argument
885 rdma_for_each_port (ib_dev, p) { in gid_table_release_one()
886 release_gid_table(ib_dev, ib_dev->port_data[p].cache.gid); in gid_table_release_one()
887 ib_dev->port_data[p].cache.gid = NULL; in gid_table_release_one()
891 static int _gid_table_setup_one(struct ib_device *ib_dev) in _gid_table_setup_one() argument
896 rdma_for_each_port (ib_dev, rdma_port) { in _gid_table_setup_one()
898 ib_dev->port_data[rdma_port].immutable.gid_tbl_len); in _gid_table_setup_one()
902 gid_table_reserve_default(ib_dev, rdma_port, table); in _gid_table_setup_one()
903 ib_dev->port_data[rdma_port].cache.gid = table; in _gid_table_setup_one()
908 gid_table_release_one(ib_dev); in _gid_table_setup_one()
912 static void gid_table_cleanup_one(struct ib_device *ib_dev) in gid_table_cleanup_one() argument
916 rdma_for_each_port (ib_dev, p) in gid_table_cleanup_one()
917 cleanup_gid_table_port(ib_dev, p, in gid_table_cleanup_one()
918 ib_dev->port_data[p].cache.gid); in gid_table_cleanup_one()
921 static int gid_table_setup_one(struct ib_device *ib_dev) in gid_table_setup_one() argument
925 err = _gid_table_setup_one(ib_dev); in gid_table_setup_one()
930 rdma_roce_rescan_device(ib_dev); in gid_table_setup_one()