/** * struct libeth_sqe - represents a Send Queue Element / Tx buffer * @type: type of the buffer, see the enum above * @rs_idx: index of the last buffer from the batch this one was sent in * @raw: slab buffer to free via kfree() * @skb: &sk_buff to consume * @sinfo: skb shared info of an XDP_TX frame * @xdpf: XDP frame from ::ndo_xdp_xmit() * @xsk: XSk Rx frame from XDP_TX action * @dma: DMA address to unmap * @len: length of the mapped region to unmap * @nr_frags: number of frags in the frame this buffer belongs to * @packets: number of physical packets sent for this frame * @bytes: number of physical bytes sent for this frame * @priv: driver-private scratchpad
*/ struct libeth_sqe { enum libeth_sqe_type type:32;
u32 rs_idx;
/** * LIBETH_SQE_CHECK_PRIV - check the driver's private SQE data * @p: type or name of the object the driver wants to fit into &libeth_sqe * * Make sure the driver's private data fits into libeth_sqe::priv. To be used * right after its declaration.
*/ #define LIBETH_SQE_CHECK_PRIV(p) \
static_assert(sizeof(p) <= sizeof_field(struct libeth_sqe, priv))
/** * struct libeth_cq_pp - completion queue poll params * @dev: &device to perform DMA unmapping * @bq: XDP frame bulk to combine return operations * @ss: onstack NAPI stats to fill * @xss: onstack XDPSQ NAPI stats to fill * @xdp_tx: number of XDP-not-XSk frames processed * @napi: whether it's called from the NAPI context * * libeth uses this structure to access objects needed for performing full * Tx complete operation without passing lots of arguments and change the * prototypes each time a new one is added.
*/ struct libeth_cq_pp { struct device *dev; struct xdp_frame_bulk *bq;
/** * libeth_tx_complete - perform Tx completion for one SQE * @sqe: SQE to complete * @cp: poll params * * Do Tx complete for all the types of buffers, incl. freeing, unmapping, * updating the stats etc.
*/ staticinlinevoid libeth_tx_complete(struct libeth_sqe *sqe, conststruct libeth_cq_pp *cp)
{ switch (sqe->type) { case LIBETH_SQE_EMPTY: return; case LIBETH_SQE_SKB: case LIBETH_SQE_FRAG: case LIBETH_SQE_SLAB:
dma_unmap_page(cp->dev, dma_unmap_addr(sqe, dma),
dma_unmap_len(sqe, len), DMA_TO_DEVICE); break; default: break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.