HomeFreeBSD

LinuxKPI: add simplified version of page_frag_cache

Description

LinuxKPI: add simplified version of page_frag_cache

For the moment and the currently only consumer (mt76) add a simplified
version of the page_frag_cache. We will only accept fragement sizes up
to 1 PAGE_SIZE (KASSERT) and we will always return a full page.
Should we add more consumers or small (or large) objects would become a
problem we can always add a more elaborate version.

Discussed with: markj
Reviewed by: markj (,hselasky commented as well)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D37595

(cherry picked from commit 55038a6306a570c9f2df89f5ad076de0f7d98152)

LinuxKPI: fix possible NULL dereference in linuxkpi_page_frag_alloc()

Reported by: Coverity via emaste
Coverity ID: 1502345
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 51e94a4658d23016dd0ae67c189a89f53281cbcd)

Details

Provenance
bzAuthored on Dec 3 2022, 12:33 AM
Reviewer
markj
Differential Revision
D37595: LinuxKPI: add simplified vesion of page_frag_cache
Parents
rGaca218556485: LinuxKPI: pm.h add pm_sleep_ptr and DEFINE_SIMPLE_DEV_PM_OPS
Branches
Unknown
Tags
Unknown