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, Mar 11, 11:24 AM
Unknown Object (File)
Jan 29 2025, 7:43 AM
Unknown Object (File)
Jan 28 2025, 10:51 AM
Unknown Object (File)
Jan 22 2025, 11:47 AM
Unknown Object (File)
Jan 16 2025, 12:51 PM
Unknown Object (File)
Jan 13 2025, 3:00 PM
Unknown Object (File)
Jan 5 2025, 7:28 AM
Unknown Object (File)
Dec 18 2024, 12:13 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.