| 145 | } |
| 146 | |
| 147 | void |
| 148 | __vhost_log_write(struct virtio_net *dev, uint64_t addr, uint64_t len) |
| 149 | { |
| 150 | uint64_t page; |
| 151 | |
| 152 | if (unlikely(!dev->log_base || !len)) |
| 153 | return; |
| 154 | |
| 155 | if (unlikely(dev->log_size <= ((addr + len - 1) / VHOST_LOG_PAGE / 8))) |
| 156 | return; |
| 157 | |
| 158 | /* To make sure guest memory updates are committed before logging */ |
| 159 | rte_atomic_thread_fence(rte_memory_order_release); |
| 160 | |
| 161 | page = addr / VHOST_LOG_PAGE; |
| 162 | while (page * VHOST_LOG_PAGE < addr + len) { |
| 163 | vhost_log_page((uint8_t *)(uintptr_t)dev->log_base, page); |
| 164 | page += 1; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | void |
| 169 | __vhost_log_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq, |
no test coverage detected