Page MenuHomeFreeBSD

netmap: Remove duplicate code
AbandonedPublic

Authored by markj on Sep 13 2024, 7:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 28, 1:33 AM
Unknown Object (File)
Sun, Apr 26, 9:38 PM
Unknown Object (File)
Fri, Apr 24, 8:52 PM
Unknown Object (File)
Sun, Apr 19, 4:27 PM
Unknown Object (File)
Tue, Apr 7, 3:00 AM
Unknown Object (File)
Mon, Apr 6, 8:27 AM
Unknown Object (File)
Wed, Apr 1, 6:25 PM
Unknown Object (File)
Wed, Apr 1, 12:16 AM
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.