Page MenuHomeFreeBSD

netmap: Remove duplicate code
AbandonedPublic

Authored by markj on Sep 13 2024, 7:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 7:31 AM
Unknown Object (File)
Tue, Nov 12, 11:35 PM
Unknown Object (File)
Thu, Nov 7, 6:03 AM
Unknown Object (File)
Sat, Oct 19, 2:12 AM
Unknown Object (File)
Oct 4 2024, 1:03 AM
Unknown Object (File)
Sep 29 2024, 11:05 PM
Unknown Object (File)
Sep 24 2024, 7:59 PM
Unknown Object (File)
Sep 24 2024, 5:33 PM
Subscribers

Details

Reviewers
vmaffione
Summary

This duplicates code in netmap_get_na() which looks up the memory
allocator specified by nr_mem_id, so let's deduplicate.

No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59476
Build 56363: arc lint + arc unit

Event Timeline

markj requested review of this revision.Sep 13 2024, 7:59 PM

I guess you mean that the same code is present inside netmap_get_na which is call right after.
However, with this change the behaviour would not be equivalent, because netmap_mem_find grabs a reference to a netmap memory allocator.
So before this patch the reference is kept along the whole netmap_ioctl function, whereas with the patch the reference scope drops to the duration o the netmap_get_na call.

I guess you mean that the same code is present inside netmap_get_na which is call right after.
However, with this change the behaviour would not be equivalent, because netmap_mem_find grabs a reference to a netmap memory allocator.
So before this patch the reference is kept along the whole netmap_ioctl function, whereas with the patch the reference scope drops to the duration o the netmap_get_na call.

I see now, apologies for the bogus patch. I thought I had tested the req->nr_mem_id != 0 case but my test program was wrong.