ioat(4): Add ioat_acquire_reserve() KPI
ioat_acquire_reserve() is an extended version of ioat_acquire(). It allows users to reserve space in the channel for some number of descriptors. If this succeeds, it guarantees that at least submission of N valid descriptors will succeed. Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
eb581ab54a
commit
1502e36346
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=293390
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd January 5, 2016
|
||||
.Dd January 7, 2016
|
||||
.Dt IOAT 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -73,6 +73,8 @@ In
|
||||
.Fn ioat_get_max_coalesce_period "bus_dmaengine_t dmaengine"
|
||||
.Ft void
|
||||
.Fn ioat_acquire "bus_dmaengine_t dmaengine"
|
||||
.Ft int
|
||||
.Fn ioat_acquire_reserve "bus_dmaengine_t dmaengine" "uint32_t n" "int mflags"
|
||||
.Ft void
|
||||
.Fn ioat_release "bus_dmaengine_t dmaengine"
|
||||
.Ft struct bus_dmadesc *
|
||||
@ -178,6 +180,14 @@ When the user wants to offload a copy, they will first
|
||||
the
|
||||
.Ar bus_dmaengine_t
|
||||
object for exclusive access to enqueue operations on that channel.
|
||||
Optionally, the user can reserve space by using
|
||||
.Fn ioat_acquire_reserve
|
||||
instead.
|
||||
If
|
||||
.Fn ioat_acquire_reserve
|
||||
succeeds, there is guaranteed to be room for
|
||||
.Fa N
|
||||
new operations in the internal ring buffer.
|
||||
Then, they will submit one or more operations using
|
||||
.Fn ioat_blockfill ,
|
||||
.Fn ioat_copy ,
|
||||
|
@ -789,6 +789,21 @@ ioat_acquire(bus_dmaengine_t dmaengine)
|
||||
CTR0(KTR_IOAT, __func__);
|
||||
}
|
||||
|
||||
int
|
||||
ioat_acquire_reserve(bus_dmaengine_t dmaengine, unsigned n, int mflags)
|
||||
{
|
||||
struct ioat_softc *ioat;
|
||||
int error;
|
||||
|
||||
ioat = to_ioat_softc(dmaengine);
|
||||
ioat_acquire(dmaengine);
|
||||
|
||||
error = ioat_reserve_space(ioat, n, mflags);
|
||||
if (error != 0)
|
||||
ioat_release(dmaengine);
|
||||
return (error);
|
||||
}
|
||||
|
||||
void
|
||||
ioat_release(bus_dmaengine_t dmaengine)
|
||||
{
|
||||
|
@ -96,12 +96,25 @@ uint16_t ioat_get_max_coalesce_period(bus_dmaengine_t dmaengine);
|
||||
|
||||
/*
|
||||
* Acquire must be called before issuing an operation to perform. Release is
|
||||
* called after. Multiple operations can be issued within the context of one
|
||||
* called after. Multiple operations can be issued within the context of one
|
||||
* acquire and release
|
||||
*/
|
||||
void ioat_acquire(bus_dmaengine_t dmaengine);
|
||||
void ioat_release(bus_dmaengine_t dmaengine);
|
||||
|
||||
/*
|
||||
* Acquire_reserve can be called to ensure there is room for N descriptors. If
|
||||
* it succeeds, the next N valid operations will successfully enqueue.
|
||||
*
|
||||
* It may fail with:
|
||||
* - ENXIO if the channel is in an errored state, or the driver is being
|
||||
* unloaded
|
||||
* - EAGAIN if mflags included M_NOWAIT
|
||||
*
|
||||
* On failure, the caller does not hold the dmaengine.
|
||||
*/
|
||||
int ioat_acquire_reserve(bus_dmaengine_t dmaengine, unsigned n, int mflags);
|
||||
|
||||
/*
|
||||
* Issue a blockfill operation. The 64-bit pattern 'fillpattern' is written to
|
||||
* 'len' physically contiguous bytes at 'dst'.
|
||||
|
Loading…
Reference in New Issue
Block a user