On Mon, May 14, 2018 at 11:11:12AM +0300, Leon Romanovsky wrote: > +/** > + * rdma_put_gid_attr - Release reference to the GID attribute > + * @attr: Pointer to the GID attribute whose reference > + * needs to be released. > + * > + * rdma_put_gid_attr() must be used to release reference whose > + * reference is acquired using rdma_get_gid_attr() or any APIs > + * which returns pointer to the ib_gid_attr regardless of link layer > + * of IB or RoCE. > + * > + */ > +void rdma_put_gid_attr(const struct ib_gid_attr *attr) > +{ > + struct ib_gid_table_entry *entry = > + container_of(attr, struct ib_gid_table_entry, attr); > + struct ib_device *device = entry->attr.device; > + u8 port_num = entry->attr.port_num; > + struct ib_gid_table *table; > + > + if (!rdma_protocol_roce(device, port_num)) > + return; > + table = device->cache.ports[port_num - rdma_start_port(device)].gid; > + > + write_lock_irq(&table->rwlock); > + kref_put(&entry->kref, schedule_free_roce_gid); > + write_unlock_irq(&table->rwlock); Holding a lock here doesn't make any sense to me... Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html