/* Refresh the local tail pointer. * cached_cons is r->size bigger than the real consumer pointer so * that this addition can be avoided in the more frequently * executed code that computes free_entries in the beginning of * this function. Without this optimization it would have been * free_entries = r->cached_prod - r->cached_cons + r->size.
*/
r->cached_cons = __atomic_load_n(r->consumer, __ATOMIC_ACQUIRE);
r->cached_cons += r->size;
staticinlinevoid xsk_ring_prod__submit(struct xsk_ring_prod *prod, __u32 nb)
{ /* Make sure everything has been written to the ring before indicating * this to the kernel by writing the producer pointer.
*/
__atomic_store_n(prod->producer, *prod->producer + nb, __ATOMIC_RELEASE);
}
staticinlinevoid xsk_ring_cons__release(struct xsk_ring_cons *cons, __u32 nb)
{ /* Make sure data has been read before indicating we are done * with the entries by updating the consumer pointer.
*/
__atomic_store_n(cons->consumer, *cons->consumer + nb, __ATOMIC_RELEASE);
}
/* Set config to NULL to get the default configuration. */ int xsk_umem__create(struct xsk_umem **umem, void *umem_area, __u64 size, struct xsk_ring_prod *fill, struct xsk_ring_cons *comp, conststruct xsk_umem_config *config); int xsk_socket__create(struct xsk_socket **xsk, int ifindex, __u32 queue_id, struct xsk_umem *umem, struct xsk_ring_cons *rx, struct xsk_ring_prod *tx, conststruct xsk_socket_config *config); int xsk_socket__create_shared(struct xsk_socket **xsk_ptr, int ifindex,
__u32 queue_id, struct xsk_umem *umem, struct xsk_ring_cons *rx, struct xsk_ring_prod *tx, struct xsk_ring_prod *fill, struct xsk_ring_cons *comp, conststruct xsk_socket_config *config);
/* Returns 0 for success and -EBUSY if the umem is still in use. */ int xsk_umem__delete(struct xsk_umem *umem); void xsk_socket__delete(struct xsk_socket *xsk);
int xsk_set_mtu(int ifindex, int mtu);
#ifdef __cplusplus
} /* extern "C" */ #endif
#endif/* __XSK_H */
Messung V0.5
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet)
¤
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.