Page MenuHomeFreeBSD

netmap: Remove duplicate code
AbandonedPublic

Authored by markj on Sep 13 2024, 7:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 15, 11:08 AM
Unknown Object (File)
Fri, May 15, 12:41 AM
Unknown Object (File)
Tue, May 12, 1:28 AM
Unknown Object (File)
Mon, May 11, 9:28 PM
Unknown Object (File)
Mon, May 11, 8:55 PM
Unknown Object (File)
Fri, May 8, 4:38 PM
Unknown Object (File)
Tue, Apr 28, 1:33 AM
Unknown Object (File)
Sun, Apr 26, 9:38 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.