Lines Matching refs:off
137 static int xsk_get_mmap_offsets(int fd, struct xdp_mmap_offsets *off) in xsk_get_mmap_offsets() argument
142 optlen = sizeof(*off); in xsk_get_mmap_offsets()
143 err = getsockopt(fd, SOL_XDP, XDP_MMAP_OFFSETS, off, &optlen); in xsk_get_mmap_offsets()
147 if (optlen == sizeof(*off)) in xsk_get_mmap_offsets()
157 struct xdp_mmap_offsets off; in xsk_create_umem_rings() local
173 err = xsk_get_mmap_offsets(fd, &off); in xsk_create_umem_rings()
177 map = mmap(NULL, off.fr.desc + umem->config.fill_size * sizeof(__u64), in xsk_create_umem_rings()
185 fill->producer = map + off.fr.producer; in xsk_create_umem_rings()
186 fill->consumer = map + off.fr.consumer; in xsk_create_umem_rings()
187 fill->flags = map + off.fr.flags; in xsk_create_umem_rings()
188 fill->ring = map + off.fr.desc; in xsk_create_umem_rings()
191 map = mmap(NULL, off.cr.desc + umem->config.comp_size * sizeof(__u64), in xsk_create_umem_rings()
201 comp->producer = map + off.cr.producer; in xsk_create_umem_rings()
202 comp->consumer = map + off.cr.consumer; in xsk_create_umem_rings()
203 comp->flags = map + off.cr.flags; in xsk_create_umem_rings()
204 comp->ring = map + off.cr.desc; in xsk_create_umem_rings()
209 munmap(map, off.fr.desc + umem->config.fill_size * sizeof(__u64)); in xsk_create_umem_rings()
343 struct xdp_mmap_offsets off; in xsk_put_ctx() local
352 err = xsk_get_mmap_offsets(umem->fd, &off); in xsk_put_ctx()
356 munmap(ctx->fill->ring - off.fr.desc, off.fr.desc + umem->config.fill_size * in xsk_put_ctx()
358 munmap(ctx->comp->ring - off.cr.desc, off.cr.desc + umem->config.comp_size * in xsk_put_ctx()
414 struct xdp_mmap_offsets off; in xsk_socket__create_shared() local
482 err = xsk_get_mmap_offsets(xsk->fd, &off); in xsk_socket__create_shared()
489 rx_map = mmap(NULL, off.rx.desc + in xsk_socket__create_shared()
500 rx->producer = rx_map + off.rx.producer; in xsk_socket__create_shared()
501 rx->consumer = rx_map + off.rx.consumer; in xsk_socket__create_shared()
502 rx->flags = rx_map + off.rx.flags; in xsk_socket__create_shared()
503 rx->ring = rx_map + off.rx.desc; in xsk_socket__create_shared()
510 tx_map = mmap(NULL, off.tx.desc + in xsk_socket__create_shared()
521 tx->producer = tx_map + off.tx.producer; in xsk_socket__create_shared()
522 tx->consumer = tx_map + off.tx.consumer; in xsk_socket__create_shared()
523 tx->flags = tx_map + off.tx.flags; in xsk_socket__create_shared()
524 tx->ring = tx_map + off.tx.desc; in xsk_socket__create_shared()
556 munmap(tx_map, off.tx.desc + in xsk_socket__create_shared()
560 munmap(rx_map, off.rx.desc + in xsk_socket__create_shared()
587 struct xdp_mmap_offsets off; in xsk_umem__delete() local
596 err = xsk_get_mmap_offsets(umem->fd, &off); in xsk_umem__delete()
598 munmap(umem->fill_save->ring - off.fr.desc, in xsk_umem__delete()
599 off.fr.desc + umem->config.fill_size * sizeof(__u64)); in xsk_umem__delete()
600 munmap(umem->comp_save->ring - off.cr.desc, in xsk_umem__delete()
601 off.cr.desc + umem->config.comp_size * sizeof(__u64)); in xsk_umem__delete()
613 struct xdp_mmap_offsets off; in xsk_socket__delete() local
626 err = xsk_get_mmap_offsets(xsk->fd, &off); in xsk_socket__delete()
629 munmap(xsk->rx->ring - off.rx.desc, in xsk_socket__delete()
630 off.rx.desc + xsk->config.rx_size * desc_sz); in xsk_socket__delete()
633 munmap(xsk->tx->ring - off.tx.desc, in xsk_socket__delete()
634 off.tx.desc + xsk->config.tx_size * desc_sz); in xsk_socket__delete()