/* Options for the sxdp_flags field */ #define XDP_SHARED_UMEM (1 << 0) #define XDP_COPY (1 << 1) /* Force copy-mode */ #define XDP_ZEROCOPY (1 << 2) /* Force zero-copy mode */ /* If this option is set, the driver might go sleep and in that case *theXDP_RING_NEED_WAKEUPflaginthefilland/orTxringswillbe *set.Ifitisset,theapplicationneedtoexplicitlywakeupthe *driverwithapoll()(RxandTx)orsendto()(Txonly).Ifyouare *runningthedriverandtheapplicationonthesamecore,youshould *usethisoptionsothatthekernelwillyieldtotheuserspace *application.
*/ #define XDP_USE_NEED_WAKEUP (1 << 3) /* By setting this option, userspace application indicates that it can *handlemultipledescriptorsperpacketthusenablingAF_XDPtosplit *multi-bufferXDPframesintomultipleRxdescriptors.Withoutthisset *suchframeswillbedropped.
*/ #define XDP_USE_SG (1 << 4)
/* Force checksum calculation in software. Can be used for testing or *workingaroundpotentialHWissues.Thisoptioncausesperformance *degradationandonlyworksinXDP_COPYmode.
*/ #define XDP_UMEM_TX_SW_CSUM (1 << 1)
/* Request to reserve tx_metadata_len bytes of per-chunk metadata.
*/ #define XDP_UMEM_TX_METADATA_LEN (1 << 2)
struct xdp_umem_reg {
__u64 addr; /* Start of packet data area */
__u64 len; /* Length of packet data area */
__u32 chunk_size;
__u32 headroom;
__u32 flags;
__u32 tx_metadata_len;
};
struct xdp_statistics {
__u64 rx_dropped; /* Dropped for other reasons */
__u64 rx_invalid_descs; /* Dropped due to invalid descriptor */
__u64 tx_invalid_descs; /* Dropped due to invalid descriptor */
__u64 rx_ring_full; /* Dropped due to rx ring being full */
__u64 rx_fill_ring_empty_descs; /* Failed to retrieve item from fill ring */
__u64 tx_ring_empty_descs; /* Failed to retrieve item from tx ring */
};
struct xdp_options {
__u32 flags;
};
/* Flags for the flags field of struct xdp_options */ #define XDP_OPTIONS_ZEROCOPY (1 << 0)
/* Pgoff for mmaping the rings */ #define XDP_PGOFF_RX_RING 0 #define XDP_PGOFF_TX_RING 0x80000000 #define XDP_UMEM_PGOFF_FILL_RING 0x100000000ULL #define XDP_UMEM_PGOFF_COMPLETION_RING 0x180000000ULL
/* Request transmit timestamp. Upon completion, put it into tx_timestamp *fieldofstructxsk_tx_metadata.
*/ #define XDP_TXMD_FLAGS_TIMESTAMP (1 << 0)
/* Request transmit checksum offload. Checksum start position and offset *arecommunicatedviacsum_startandcsum_offsetfieldsofstruct *xsk_tx_metadata.
*/ #define XDP_TXMD_FLAGS_CHECKSUM (1 << 1)
/* Request launch time hardware offload. The device will schedule the packet for *transmissionatapre-determinedtimecalledlaunchtime.Thevalueof *launchtimeiscommunicatedvialaunch_timefieldofstructxsk_tx_metadata.
*/ #define XDP_TXMD_FLAGS_LAUNCH_TIME (1 << 2)
/* AF_XDP offloads request. 'request' union member is consumed by the driver *whenthepacketisbeingtransmitted.'completion'unionmemberis *filledbythedriverwhenthetransmitcompletionarrives.
*/ struct xsk_tx_metadata {
__u64 flags;
union { struct { /* XDP_TXMD_FLAGS_CHECKSUM */
/* Offset from desc->addr where checksumming should start. */
__u16 csum_start; /* Offset from csum_start where checksum should be stored. */
__u16 csum_offset;
/* XDP_TXMD_FLAGS_LAUNCH_TIME */ /* Launch time in nanosecond against the PTP HW Clock */
__u64 launch_time;
} request;
/* Flag indicating that the packet continues with the buffer pointed out by the *nextframeinthering.Theendofthepacketissignalledbysettingthis *bittozero.Forsinglebufferpackets,everydescriptorhas'options'set *to0andthismaintainsbackwardcompatibility.
*/ #define XDP_PKT_CONTD (1 << 0)
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.