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

Function is_vring_iotlb_packed

dpdk/lib/vhost/vhost_user.c:2515–2545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2513}
2514
2515static int
2516is_vring_iotlb_packed(struct vhost_virtqueue *vq, struct vhost_iotlb_msg *imsg)
2517{
2518 struct vhost_vring_addr *ra;
2519 uint64_t start, end, len;
2520
2521 start = imsg->iova;
2522 end = start + imsg->size;
2523
2524 ra = &vq->ring_addrs;
2525 len = sizeof(struct vring_packed_desc) * vq->size;
2526 if (ra->desc_user_addr < end && (ra->desc_user_addr + len) > start)
2527 return 1;
2528
2529 len = sizeof(struct vring_packed_desc_event);
2530 if (ra->avail_user_addr < end && (ra->avail_user_addr + len) > start)
2531 return 1;
2532
2533 len = sizeof(struct vring_packed_desc_event);
2534 if (ra->used_user_addr < end && (ra->used_user_addr + len) > start)
2535 return 1;
2536
2537 if (ra->flags & (1 << VHOST_VRING_F_LOG)) {
2538 len = sizeof(uint64_t);
2539 if (ra->log_guest_addr < end &&
2540 (ra->log_guest_addr + len) > start)
2541 return 1;
2542 }
2543
2544 return 0;
2545}
2546
2547static int is_vring_iotlb(struct virtio_net *dev,
2548 struct vhost_virtqueue *vq,

Callers 1

is_vring_iotlbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected