Lines Matching refs:gids

160 static int mlx4_ib_update_gids_v1(struct gid_entry *gids,  in mlx4_ib_update_gids_v1()  argument
177 memcpy(&gid_tbl[i], &gids[i].gid, sizeof(union ib_gid)); in mlx4_ib_update_gids_v1()
193 static int mlx4_ib_update_gids_v1_v2(struct gid_entry *gids, in mlx4_ib_update_gids_v1_v2() argument
216 memcpy(&gid_tbl[i].gid, &gids[i].gid, sizeof(union ib_gid)); in mlx4_ib_update_gids_v1_v2()
217 if (gids[i].gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP) { in mlx4_ib_update_gids_v1_v2()
219 if (!ipv6_addr_v4mapped((struct in6_addr *)&gids[i].gid)) in mlx4_ib_update_gids_v1_v2()
238 static int mlx4_ib_update_gids(struct gid_entry *gids, in mlx4_ib_update_gids() argument
243 return mlx4_ib_update_gids_v1_v2(gids, ibdev, port_num); in mlx4_ib_update_gids()
245 return mlx4_ib_update_gids_v1(gids, ibdev, port_num); in mlx4_ib_update_gids()
264 struct gid_entry *gids; in mlx4_ib_add_gid() local
280 port_gid_table = &iboe->gids[attr->port_num - 1]; in mlx4_ib_add_gid()
283 if (!memcmp(&port_gid_table->gids[i].gid, in mlx4_ib_add_gid()
285 port_gid_table->gids[i].gid_type == attr->gid_type && in mlx4_ib_add_gid()
286 port_gid_table->gids[i].vlan_id == vlan_id) { in mlx4_ib_add_gid()
290 if (free < 0 && rdma_is_zero_gid(&port_gid_table->gids[i].gid)) in mlx4_ib_add_gid()
298 port_gid_table->gids[free].ctx = kmalloc(sizeof(*port_gid_table->gids[free].ctx), GFP_ATOMIC); in mlx4_ib_add_gid()
299 if (!port_gid_table->gids[free].ctx) { in mlx4_ib_add_gid()
302 *context = port_gid_table->gids[free].ctx; in mlx4_ib_add_gid()
303 port_gid_table->gids[free].gid = attr->gid; in mlx4_ib_add_gid()
304 port_gid_table->gids[free].gid_type = attr->gid_type; in mlx4_ib_add_gid()
305 port_gid_table->gids[free].vlan_id = vlan_id; in mlx4_ib_add_gid()
306 port_gid_table->gids[free].ctx->real_index = free; in mlx4_ib_add_gid()
307 port_gid_table->gids[free].ctx->refcount = 1; in mlx4_ib_add_gid()
312 struct gid_cache_context *ctx = port_gid_table->gids[found].ctx; in mlx4_ib_add_gid()
317 gids = kmalloc_array(MLX4_MAX_PORT_GIDS, sizeof(*gids), in mlx4_ib_add_gid()
319 if (!gids) { in mlx4_ib_add_gid()
322 free_gid_entry(&port_gid_table->gids[free]); in mlx4_ib_add_gid()
325 memcpy(&gids[i].gid, &port_gid_table->gids[i].gid, sizeof(union ib_gid)); in mlx4_ib_add_gid()
326 gids[i].gid_type = port_gid_table->gids[i].gid_type; in mlx4_ib_add_gid()
333 ret = mlx4_ib_update_gids(gids, ibdev, attr->port_num); in mlx4_ib_add_gid()
337 free_gid_entry(&port_gid_table->gids[free]); in mlx4_ib_add_gid()
340 kfree(gids); in mlx4_ib_add_gid()
354 struct gid_entry *gids; in mlx4_ib_del_gid() local
362 port_gid_table = &iboe->gids[attr->port_num - 1]; in mlx4_ib_del_gid()
369 free_gid_entry(&port_gid_table->gids[real_index]); in mlx4_ib_del_gid()
376 gids = kmalloc_array(MLX4_MAX_PORT_GIDS, sizeof(*gids), in mlx4_ib_del_gid()
378 if (!gids) { in mlx4_ib_del_gid()
382 memcpy(&gids[i].gid, in mlx4_ib_del_gid()
383 &port_gid_table->gids[i].gid, in mlx4_ib_del_gid()
385 gids[i].gid_type = in mlx4_ib_del_gid()
386 port_gid_table->gids[i].gid_type; in mlx4_ib_del_gid()
393 ret = mlx4_ib_update_gids(gids, ibdev, attr->port_num); in mlx4_ib_del_gid()
394 kfree(gids); in mlx4_ib_del_gid()
420 port_gid_table = &iboe->gids[port_num - 1]; in mlx4_ib_gid_index_to_real_index()
423 if (!memcmp(&port_gid_table->gids[i].gid, in mlx4_ib_gid_index_to_real_index()
425 attr->gid_type == port_gid_table->gids[i].gid_type) { in mlx4_ib_gid_index_to_real_index()
426 ctx = port_gid_table->gids[i].ctx; in mlx4_ib_gid_index_to_real_index()