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

Function vhost_user_iotlb_cache_remove

dpdk/lib/vhost/iotlb.c:307–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305}
306
307void
308vhost_user_iotlb_cache_remove(struct virtio_net *dev, uint64_t iova, uint64_t size)
309{
310 struct vhost_iotlb_entry *node, *temp_node, *prev_node = NULL;
311
312 if (unlikely(!size))
313 return;
314
315 vhost_user_iotlb_wr_lock_all(dev);
316
317 RTE_TAILQ_FOREACH_SAFE(node, &dev->iotlb_list, next, temp_node) {
318 /* Sorted list */
319 if (unlikely(iova + size < node->iova))
320 break;
321
322 if (iova < node->iova + node->size) {
323 struct vhost_iotlb_entry *next_node = RTE_TAILQ_NEXT(node, next);
324
325 vhost_user_iotlb_clear_dump(node, prev_node, next_node);
326
327 TAILQ_REMOVE(&dev->iotlb_list, node, next);
328 vhost_user_iotlb_remove_notify(dev, node);
329 vhost_user_iotlb_pool_put(dev, node);
330 dev->iotlb_cache_nr--;
331 } else {
332 prev_node = node;
333 }
334 }
335
336 vhost_user_iotlb_wr_unlock_all(dev);
337}
338
339uint64_t
340vhost_user_iotlb_cache_find(struct virtio_net *dev, uint64_t iova, uint64_t *size, uint8_t perm)

Callers 2

vduse_events_handlerFunction · 0.85
vhost_user_iotlb_msgFunction · 0.85

Calls 3

Tested by

no test coverage detected