MCPcopy Create free account
hub / github.com/F-Stack/f-stack / is_vring_iotlb_split

Function is_vring_iotlb_split

dpdk/lib/vhost/vhost_user.c:2482–2513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2480}
2481
2482static int
2483is_vring_iotlb_split(struct vhost_virtqueue *vq, struct vhost_iotlb_msg *imsg)
2484{
2485 struct vhost_vring_addr *ra;
2486 uint64_t start, end, len;
2487
2488 start = imsg->iova;
2489 end = start + imsg->size;
2490
2491 ra = &vq->ring_addrs;
2492 len = sizeof(struct vring_desc) * vq->size;
2493 if (ra->desc_user_addr < end && (ra->desc_user_addr + len) > start)
2494 return 1;
2495
2496 len = sizeof(struct vring_avail) + sizeof(uint16_t) * vq->size;
2497 if (ra->avail_user_addr < end && (ra->avail_user_addr + len) > start)
2498 return 1;
2499
2500 len = sizeof(struct vring_used) +
2501 sizeof(struct vring_used_elem) * vq->size;
2502 if (ra->used_user_addr < end && (ra->used_user_addr + len) > start)
2503 return 1;
2504
2505 if (ra->flags & (1 << VHOST_VRING_F_LOG)) {
2506 len = sizeof(uint64_t);
2507 if (ra->log_guest_addr < end &&
2508 (ra->log_guest_addr + len) > start)
2509 return 1;
2510 }
2511
2512 return 0;
2513}
2514
2515static int
2516is_vring_iotlb_packed(struct vhost_virtqueue *vq, struct vhost_iotlb_msg *imsg)

Callers 1

is_vring_iotlbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected