| 2183 | } |
| 2184 | |
| 2185 | static __rte_always_inline void |
| 2186 | write_back_completed_descs_split(struct vhost_virtqueue *vq, uint16_t n_descs) |
| 2187 | __rte_shared_locks_required(&vq->access_lock) |
| 2188 | { |
| 2189 | struct vhost_async *async = vq->async; |
| 2190 | uint16_t nr_left = n_descs; |
| 2191 | uint16_t nr_copy; |
| 2192 | uint16_t to, from; |
| 2193 | |
| 2194 | do { |
| 2195 | from = async->last_desc_idx_split & (vq->size - 1); |
| 2196 | nr_copy = nr_left + from <= vq->size ? nr_left : vq->size - from; |
| 2197 | to = vq->last_used_idx & (vq->size - 1); |
| 2198 | |
| 2199 | if (to + nr_copy <= vq->size) { |
| 2200 | rte_memcpy(&vq->used->ring[to], &async->descs_split[from], |
| 2201 | nr_copy * sizeof(struct vring_used_elem)); |
| 2202 | } else { |
| 2203 | uint16_t size = vq->size - to; |
| 2204 | |
| 2205 | rte_memcpy(&vq->used->ring[to], &async->descs_split[from], |
| 2206 | size * sizeof(struct vring_used_elem)); |
| 2207 | rte_memcpy(&vq->used->ring[0], &async->descs_split[from + size], |
| 2208 | (nr_copy - size) * sizeof(struct vring_used_elem)); |
| 2209 | } |
| 2210 | |
| 2211 | async->last_desc_idx_split += nr_copy; |
| 2212 | vq->last_used_idx += nr_copy; |
| 2213 | nr_left -= nr_copy; |
| 2214 | } while (nr_left > 0); |
| 2215 | } |
| 2216 | |
| 2217 | static __rte_always_inline void |
| 2218 | write_back_completed_descs_packed(struct vhost_virtqueue *vq, |
no test coverage detected