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

Function vhost_user_iotlb_pending_insert

dpdk/lib/vhost/iotlb.c:146–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void
147vhost_user_iotlb_pending_insert(struct virtio_net *dev, uint64_t iova, uint8_t perm)
148{
149 struct vhost_iotlb_entry *node;
150
151 node = vhost_user_iotlb_pool_get(dev);
152 if (node == NULL) {
153 VHOST_LOG_CONFIG(dev->ifname, DEBUG,
154 "IOTLB pool empty, clear entries for pending insertion\n");
155 if (!TAILQ_EMPTY(&dev->iotlb_pending_list))
156 vhost_user_iotlb_pending_remove_all(dev);
157 else
158 vhost_user_iotlb_cache_random_evict(dev);
159 node = vhost_user_iotlb_pool_get(dev);
160 if (node == NULL) {
161 VHOST_LOG_CONFIG(dev->ifname, ERR,
162 "IOTLB pool still empty, pending insertion failure\n");
163 return;
164 }
165 }
166
167 node->iova = iova;
168 node->perm = perm;
169
170 rte_rwlock_write_lock(&dev->iotlb_pending_lock);
171
172 TAILQ_INSERT_TAIL(&dev->iotlb_pending_list, node, next);
173
174 rte_rwlock_write_unlock(&dev->iotlb_pending_lock);
175}
176
177void
178vhost_user_iotlb_pending_remove(struct virtio_net *dev, uint64_t iova, uint64_t size, uint8_t perm)

Callers 1

__vhost_iova_to_vvaFunction · 0.85

Tested by

no test coverage detected