Page MenuHomeFreeBSD

netmap: Remove duplicate code
AbandonedPublic

Authored by markj on Sep 13 2024, 7:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 13, 3:00 PM
Unknown Object (File)
Sun, Jan 5, 7:28 AM
Unknown Object (File)
Wed, Dec 18, 12:13 PM
Unknown Object (File)
Dec 4 2024, 3:32 PM
Unknown Object (File)
Nov 16 2024, 7:31 AM
Unknown Object (File)
Nov 12 2024, 11:35 PM
Unknown Object (File)
Nov 7 2024, 6:03 AM
Unknown Object (File)
Oct 19 2024, 2:12 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.