Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/sglist.9
Show All 28 Lines | |||||
.Dd May 16, 2017 | .Dd May 16, 2017 | ||||
.Dt SGLIST 9 | .Dt SGLIST 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm sglist , | .Nm sglist , | ||||
.Nm sglist_alloc , | .Nm sglist_alloc , | ||||
.Nm sglist_append , | .Nm sglist_append , | ||||
.Nm sglist_append_bio , | .Nm sglist_append_bio , | ||||
.Nm sglist_append_ext_pgs, | |||||
.Nm sglist_append_mb_ext_pgs, | |||||
.Nm sglist_append_mbuf , | .Nm sglist_append_mbuf , | ||||
.Nm sglist_append_phys , | .Nm sglist_append_phys , | ||||
.Nm sglist_append_sglist , | .Nm sglist_append_sglist , | ||||
.Nm sglist_append_uio , | .Nm sglist_append_uio , | ||||
.Nm sglist_append_user , | .Nm sglist_append_user , | ||||
.Nm sglist_append_vmpages , | .Nm sglist_append_vmpages , | ||||
.Nm sglist_build , | .Nm sglist_build , | ||||
.Nm sglist_clone , | .Nm sglist_clone , | ||||
.Nm sglist_consume_uio , | .Nm sglist_consume_uio , | ||||
.Nm sglist_count , | .Nm sglist_count , | ||||
.Nm sglist_count_ext_pgs , | |||||
.Nm sglist_count_mb_ext_pgs , | |||||
.Nm sglist_count_vmpages , | .Nm sglist_count_vmpages , | ||||
.Nm sglist_free , | .Nm sglist_free , | ||||
.Nm sglist_hold , | .Nm sglist_hold , | ||||
.Nm sglist_init , | .Nm sglist_init , | ||||
.Nm sglist_join , | .Nm sglist_join , | ||||
.Nm sglist_length , | .Nm sglist_length , | ||||
.Nm sglist_reset , | .Nm sglist_reset , | ||||
.Nm sglist_slice , | .Nm sglist_slice , | ||||
.Nm sglist_split | .Nm sglist_split | ||||
.Nd manage a scatter/gather list of physical memory addresses | .Nd manage a scatter/gather list of physical memory addresses | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/types.h | .In sys/types.h | ||||
.In sys/sglist.h | .In sys/sglist.h | ||||
.Ft struct sglist * | .Ft struct sglist * | ||||
.Fn sglist_alloc "int nsegs" "int mflags" | .Fn sglist_alloc "int nsegs" "int mflags" | ||||
.Ft int | .Ft int | ||||
.Fn sglist_append "struct sglist *sg" "void *buf" "size_t len" | .Fn sglist_append "struct sglist *sg" "void *buf" "size_t len" | ||||
.Ft int | .Ft int | ||||
.Fn sglist_append_bio "struct sglist *sg" "struct bio *bp" | .Fn sglist_append_bio "struct sglist *sg" "struct bio *bp" | ||||
.Ft int | .Ft int | ||||
.Fn sglist_append_ext_pgs "struct sglist *sg" "struct mbuf_ext_pgs *ext_pgs" "size_t offset" "size_t len" | |||||
.Ft int | |||||
.Fn sglist_append_mb_ext_pgs "struct sglist *sg" "struct mbuf *m" | |||||
.Ft int | |||||
.Fn sglist_append_mbuf "struct sglist *sg" "struct mbuf *m" | .Fn sglist_append_mbuf "struct sglist *sg" "struct mbuf *m" | ||||
.Ft int | .Ft int | ||||
.Fn sglist_append_phys "struct sglist *sg" "vm_paddr_t paddr" "size_t len" | .Fn sglist_append_phys "struct sglist *sg" "vm_paddr_t paddr" "size_t len" | ||||
.Ft int | .Ft int | ||||
.Fn sglist_append_sglist "struct sglist *sg" "struct sglist *source" "size_t offset" "size_t len" | .Fn sglist_append_sglist "struct sglist *sg" "struct sglist *source" "size_t offset" "size_t len" | ||||
.Ft int | .Ft int | ||||
.Fn sglist_append_uio "struct sglist *sg" "struct uio *uio" | .Fn sglist_append_uio "struct sglist *sg" "struct uio *uio" | ||||
.Ft int | .Ft int | ||||
.Fn sglist_append_user "struct sglist *sg" "void *buf" "size_t len" "struct thread *td" | .Fn sglist_append_user "struct sglist *sg" "void *buf" "size_t len" "struct thread *td" | ||||
.Ft int | .Ft int | ||||
.Fn sglist_append_vmpages "struct sglist *sg" "vm_page_t *m" "size_t pgoff" "size_t len" | .Fn sglist_append_vmpages "struct sglist *sg" "vm_page_t *m" "size_t pgoff" "size_t len" | ||||
.Ft struct sglist * | .Ft struct sglist * | ||||
.Fn sglist_build "void *buf" "size_t len" "int mflags" | .Fn sglist_build "void *buf" "size_t len" "int mflags" | ||||
.Ft struct sglist * | .Ft struct sglist * | ||||
.Fn sglist_clone "struct sglist *sg" "int mflags" | .Fn sglist_clone "struct sglist *sg" "int mflags" | ||||
.Ft int | .Ft int | ||||
.Fn sglist_consume_uio "struct sglist *sg" "struct uio *uio" "size_t resid" | .Fn sglist_consume_uio "struct sglist *sg" "struct uio *uio" "size_t resid" | ||||
.Ft int | .Ft int | ||||
.Fn sglist_count "void *buf" "size_t len" | .Fn sglist_count "void *buf" "size_t len" | ||||
.Ft int | .Ft int | ||||
.Fn sglist_count_ext_pgs "struct mbuf_ext_pgs *ext_pgs" "size_t offset" "size_t len" | |||||
.Ft int | |||||
.Fn sglist_count_mb_ext_pgs "struct mbuf *m" | |||||
.Ft int | |||||
.Fn sglist_count_vmpages "vm_page_t *m" "size_t pgoff" "size_t len" | .Fn sglist_count_vmpages "vm_page_t *m" "size_t pgoff" "size_t len" | ||||
.Ft void | .Ft void | ||||
.Fn sglist_free "struct sglist *sg" | .Fn sglist_free "struct sglist *sg" | ||||
.Ft struct sglist * | .Ft struct sglist * | ||||
.Fn sglist_hold "struct sglist *sg" | .Fn sglist_hold "struct sglist *sg" | ||||
.Ft void | .Ft void | ||||
.Fn sglist_init "struct sglist *sg" "int maxsegs" "struct sglist_seg *segs" | .Fn sglist_init "struct sglist *sg" "int maxsegs" "struct sglist_seg *segs" | ||||
.Ft int | .Ft int | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
the physical address ranges mapped by a single kernel virtual address range. | the physical address ranges mapped by a single kernel virtual address range. | ||||
The kernel virtual address range starts at | The kernel virtual address range starts at | ||||
.Fa buf | .Fa buf | ||||
and is | and is | ||||
.Fa len | .Fa len | ||||
bytes long. | bytes long. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Nm sglist_count_ext_pgs | |||||
function returns the number of scatter/gather list elements needed to describe | |||||
the unmapped external mbuf buffer | |||||
.Fa ext_pgs . | |||||
The ranges start at an offset of | |||||
.Fa offset | |||||
relative to the start of the buffer and is | |||||
.Fa len | |||||
bytes long. | |||||
The | |||||
.Nm sglist_count_mb_ext_pgs | |||||
function returns the number of scatter/gather list elements needed to describe | |||||
the physical address ranges of a single unmapped mbuf | |||||
.Fa m . | |||||
.Pp | |||||
The | |||||
.Nm sglist_count_vmpages | .Nm sglist_count_vmpages | ||||
function returns the number of scatter/gather list elements needed to describe | function returns the number of scatter/gather list elements needed to describe | ||||
the physical address ranges of a buffer backed by an array of virtual memory | the physical address ranges of a buffer backed by an array of virtual memory | ||||
pages | pages | ||||
.Fa m . | .Fa m . | ||||
The buffer starts at an offset of | The buffer starts at an offset of | ||||
.Fa pgoff | .Fa pgoff | ||||
bytes relative to the first page and is | bytes relative to the first page and is | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||
The | The | ||||
.Nm sglist_append_bio | .Nm sglist_append_bio | ||||
function appends the physical address ranges described by a single bio | function appends the physical address ranges described by a single bio | ||||
.Fa bp | .Fa bp | ||||
to the scatter/gather list | to the scatter/gather list | ||||
.Fa sg . | .Fa sg . | ||||
.Pp | .Pp | ||||
The | The | ||||
.Nm sglist_append_ext_pgs | |||||
function appends the physical address ranges described by the unmapped | |||||
external mbuf buffer | |||||
.Fa ext_pgs | |||||
to the scatter/gather list | |||||
.Fa sg . | |||||
The physical address ranges start at offset | |||||
.Fa offset | |||||
within | |||||
.Fa ext_pgs | |||||
and continue for | |||||
.Fa len | |||||
bytes. | |||||
.Pp | |||||
The | |||||
.Nm sglist_append_mb_ext_pgs | |||||
function appends the physical address ranges described by the unmapped | |||||
mbuf | |||||
.Fa m | |||||
to the scatter/gather list | |||||
.Fa sg . | |||||
Note that unlike | |||||
.Nm sglist_append_mbuf , | |||||
.Nm sglist_append_mb_ext_pgs | |||||
only adds ranges for a single mbuf, | |||||
not an entire mbuf chain. | |||||
.Pp | |||||
The | |||||
.Nm sglist_append_mbuf | .Nm sglist_append_mbuf | ||||
function appends the physical address ranges described by an entire mbuf | function appends the physical address ranges described by an entire mbuf | ||||
chain | chain | ||||
.Fa m | .Fa m | ||||
to the scatter/gather list | to the scatter/gather list | ||||
.Fa sg . | .Fa sg . | ||||
.Pp | .Pp | ||||
The | The | ||||
▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | |||||
.Nm sglist_join , | .Nm sglist_join , | ||||
.Nm sglist_slice , | .Nm sglist_slice , | ||||
and | and | ||||
.Nm sglist_split | .Nm sglist_split | ||||
functions return zero on success or an error on failure. | functions return zero on success or an error on failure. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Nm sglist_count | .Nm sglist_count | ||||
and | family of | ||||
.Nm sglist_count_vmpages | |||||
functions return a count of scatter/gather list elements. | functions return a count of scatter/gather list elements. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Nm sglist_length | .Nm sglist_length | ||||
function returns a count of address space described by a scatter/gather list | function returns a count of address space described by a scatter/gather list | ||||
in bytes. | in bytes. | ||||
.Sh ERRORS | .Sh ERRORS | ||||
The | The | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |