pciv_send(9F) Kernel Functions for Drivers pciv_send(9F)NAMEpciv_send - enable communication between PCI SR-IOV PF and VF drivers
SYNOPSIS
#include <sys/sunddi.h>
int pciv_send(dev_info_t *dip, pciv_pvp_req_t *req);
PARAMETERS
dip Pointer to the dev_info structure.
req Pointer to pciv_pvp_req structure.
typedef struct pciv_pvp_req {
int pvp_dstfunc;
caddr_t pvp_buf;
size_t pvp_nbyte;
buf_cb_t pvp_cb;
caddr_t pvp_cb_arg;
uint_t pvp_flag;
} pciv_pvp_req_t
pvp_dstfunc VF index ranges from 1 to num_vf if called by PF
driver. PCIV_PF if the caller is a VF driver.
pvp_buf Buffer address of caller's buffer to be sent.
pvp_nbyte Number of bytes to be transmitted, which must be
less than 8k.
pvp_cb Call back function pointer if the pvp_flag is set
as PCIV_NOWAIT.
pvp_cb_arg Call back input argument for pvp_cb if the
pvp_flag is set as PCIV_NOWAIT.
pvp_flag Must be one of the following:
PCIV_NOWAIT Do not wait for receiver's
acknowledgment response.
PCIV_WAIT Wait until receiver acknowledges
the transmission (default).
DESCRIPTION
The pciv_send() function is used by SR-IOV (Single-Root IO Virtualiza‐
tion)-capable PF (Physical Function) and VF (Virtual Function) drivers
to communicate with each other. A PF driver can communicate with any of
its VF drivers while a VF driver can only communicate with its PF
driver. If pvp_flag is set to PCIV_NOWAIT, the call returns immediately
and the callback routine in pvp_cb is called when data in pvp_buf has
been transmitted to the destination. The caller is then allowed to free
the buffer in its callback routine.
typedef void (*buf_cb_t)(int rc, caddr_t buf, size_t size, caddr_t cb_arg);
rc DDI return code for the transmission.
buf Buffer address of caller's buffer to be sent.
size Number of bytes to be transmitted.
cb_arg Input argument the caller set when calling pciv_send().
RETURN VALUES
The pciv_send() function returns:
DDI_SUCCESS The buffer has been sent successfully.
DDI_ENOTSUP The device/driver does not support this operation.
The caller may use other mechanisms, such as hardware
mailbox.
DDI_EINVAL The pvp_nbyte or pvp_dstfunc argument is invalid.
ENOMEM The operation failed due to lack of resources.
DDI_ETRANSPORT The remote end did not register a call back to handle
incoming transmission.
DDI_FAILURE The call failed due unspecified reasons.
CONTEXT
The pciv_send() function can be called from kernel non-interrupt con‐
text.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
┌─────────────────────────────┬─────────────────────────────┐
│ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
├─────────────────────────────┼─────────────────────────────┤
│Interface Stability │Uncommitted │
├─────────────────────────────┼─────────────────────────────┤
│MT-Level │Unsafe │
└─────────────────────────────┴─────────────────────────────┘
SEE ALSOattributes(5), ddi_cb_register(9F)SunOS 5.10 19 May 2011 pciv_send(9F)