/* Forwarding UDP:8080 to AF_XDP */ if (udp->dest != bpf_htons(8080)) return XDP_PASS;
/* Reserve enough for all custom metadata. */
ret = bpf_xdp_adjust_meta(ctx, -(int)sizeof(struct xdp_meta)); if (ret != 0) return XDP_DROP;
data = (void *)(long)ctx->data;
data_meta = (void *)(long)ctx->data_meta;
if (data_meta + sizeof(struct xdp_meta) > data) return XDP_DROP;
meta = data_meta;
/* Export metadata. */
/* We expect veth bpf_xdp_metadata_rx_timestamp to return 0 HW * timestamp, so put some non-zero value into AF_XDP frame for * the userspace.
*/
bpf_xdp_metadata_rx_timestamp(ctx, ×tamp); if (timestamp == 0)
meta->rx_timestamp = 1;
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.