Page MenuHomeFreeBSD

ofed: fix GID table reference leak in roce_gid_update_addr_callback()
Needs ReviewPublic

Authored by aehrenberg_nvidia.com on Tue, Jul 28, 9:09 AM.

Details

Reviewers
kib
slavash
jhb
Summary

The "add missing GIDs" loop uses rdma_find_gid_by_port() to test whether
a GID already exists, but forgets to drop the reference it returns. So
every rescan that finds an existing GID leaks one, which pins the entry
and prevents its slot from ever being freed on delete.
Just release the reference once the GID is found, like the "remove stale
GIDs" loop already does.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
264

Same question, what ensures that the gid is still at the index between search and update?

Should the put() be done after update_gid()?